29 #include YFM_YCLib_Keys
30 #include YFM_YCLib_NativeAPI
39 return keys._Find_first();
41 # error "Only libstdc++ is currently supported."
49 return keys._Find_next(key);
51 # error "Only libstdc++ is currently supported."
578 Editing | NonKeyboard
581 # error "Unsupported platform found."
590 return KeyCategoryTable[code];
596 for(
auto code(
FindFirstKey(keys)); code != KeyBitsetWidth;
600 return KeyBitsetWidth;
614 using namespace KeyCodes;
616 return std::isalpha(
s) && FetchLockState(CapsLock) ?
s ^ 0x20 :
s;
626 return ::MapVirtualKeyW(
unsigned(code), MAPVK_VK_TO_CHAR) & 0x7F;
635 for(
std::size_t i(1); i < platform::KeyBitsetWidth - 1; ++i)
636 state[i] = keys[i] ? 0x80 : 0;
637 return ::ToAscii(code, ::MapVirtualKeyW(code, MAPVK_VK_TO_VSC), state, &s,
638 0) == 1 ? switch_key(
char(s) & 0x7F) : char();
657 #if YCL_DS || YCL_Android
658 return code == CapsLock ? caps_lock :
false;
660 return (::GetKeyState(code) & 0x0001) != 0;
667 #if YCL_DS || YCL_Android
669 caps_lock = !caps_lock;
673 ::INPUT input[2]{{INPUT_KEYBOARD, {}}, {INPUT_KEYBOARD, {}}};
676 input[0].ki.wVk = code, input[1].ki.wVk = code,
677 input[1].ki.dwFlags = KEYEVENTF_KEYUP
679 ::SendInput(2, input,
sizeof(::INPUT));
std::size_t KeyIndex
按键索引类型:标识特定的按键在按键集合中的位置。
表示编辑键(如回车、空格、退格、插入、删除和制表符)
std::size_t size ynothrow
#define yunseq
无序列依赖表达式组求值。
YF_API KeyIndex FindFirstKey(const KeyInput &) ynothrow
找到输入缓冲区记录中最小的按键编码。
#define yconstraint
约束:接口语义。
Category ClassifyKey(KeyIndex code) ynothrow
#define yconstexpr
指定编译时常量表达式。
YF_API KeyIndex FindFirstKeyInCategroy(const KeyInput &, KeyIndex) ynothrow
找到第一个在指定类别的按键编码。
YF_API KeyIndex FindNextKey(const KeyInput &, KeyIndex) ynothrow
找到输入缓冲区记录中大于指定编码的最小的按键编码。
表示导航键(如方向键和 PgUp )、菜单键和 Esc 。
std::bitset< KeyBitsetWidth > KeyInput
按键并行位宽。
表示系统键(如 SysRq/PrintScr 、 Break/Pause 和电源管理)。