1 Star 0 Fork 0

ft.ink/ft_dev

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ft_dev_keycode.h 29.78 KB
一键复制 编辑 原始数据 按行查看 历史
almpazel 提交于 2024-11-05 21:08 . ref: move
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
#include "ft_os.h"
#include "ft_units.h"
#ifndef _FT_KeyCode_H_
#define _FT_KeyCode_H_
#define FT_Key_ScanCode_MASK (1<<30)
#define FT_ScanCode_TO_KEYCODE(X) (X | FT_Key_ScanCode_MASK)
typedef enum FT_ScanCode
{
FT_ScanCode_UNKNOWN = 0,
/**
* \name Usage page 0x07
*
* These values are from usage page 0x07 (USB keyboard page).
*/
/* @{ */
FT_ScanCode_A = 4,
FT_ScanCode_B = 5,
FT_ScanCode_C = 6,
FT_ScanCode_D = 7,
FT_ScanCode_E = 8,
FT_ScanCode_F = 9,
FT_ScanCode_G = 10,
FT_ScanCode_H = 11,
FT_ScanCode_I = 12,
FT_ScanCode_J = 13,
FT_ScanCode_K = 14,
FT_ScanCode_L = 15,
FT_ScanCode_M = 16,
FT_ScanCode_N = 17,
FT_ScanCode_O = 18,
FT_ScanCode_P = 19,
FT_ScanCode_Q = 20,
FT_ScanCode_R = 21,
FT_ScanCode_S = 22,
FT_ScanCode_T = 23,
FT_ScanCode_U = 24,
FT_ScanCode_V = 25,
FT_ScanCode_W = 26,
FT_ScanCode_X = 27,
FT_ScanCode_Y = 28,
FT_ScanCode_Z = 29,
FT_ScanCode_1 = 30,
FT_ScanCode_2 = 31,
FT_ScanCode_3 = 32,
FT_ScanCode_4 = 33,
FT_ScanCode_5 = 34,
FT_ScanCode_6 = 35,
FT_ScanCode_7 = 36,
FT_ScanCode_8 = 37,
FT_ScanCode_9 = 38,
FT_ScanCode_0 = 39,
FT_ScanCode_RETURN = 40,
FT_ScanCode_ESCAPE = 41,
FT_ScanCode_BACKSPACE = 42,
FT_ScanCode_TAB = 43,
FT_ScanCode_SPACE = 44,
FT_ScanCode_MINUS = 45,
FT_ScanCode_EQUALS = 46,
FT_ScanCode_LEFTBRACKET = 47,
FT_ScanCode_RIGHTBRACKET = 48,
FT_ScanCode_BACKSLASH = 49, /**< Located at the lower left of the return
* key on ISO keyboards and at the right end
* of the QWERTY row on ANSI keyboards.
* Produces REVERSE SOLIDUS (backslash) and
* VERTICAL LINE in a US layout, REVERSE
* SOLIDUS and VERTICAL LINE in a UK Mac
* layout, NUMBER SIGN and TILDE in a UK
* Windows layout, DOLLAR SIGN and POUND SIGN
* in a Swiss German layout, NUMBER SIGN and
* APOSTROPHE in a German layout, GRAVE
* ACCENT and POUND SIGN in a French Mac
* layout, and ASTERISK and MICRO SIGN in a
* French Windows layout.
*/
FT_ScanCode_NONUSHASH = 50, /**< ISO USB keyboards actually use this code
* instead of 49 for the same key, but all
* OSes I've seen treat the two codes
* identically. So, as an implementor, unless
* your keyboard generates both of those
* codes and your OS treats them differently,
* you should generate FT_ScanCode_BACKSLASH
* instead of this code. As a user, you
* should not rely on this code because FT
* will never generate it with most (all?)
* keyboards.
*/
FT_ScanCode_SEMICOLON = 51,
FT_ScanCode_APOSTROPHE = 52,
FT_ScanCode_GRAVE = 53, /**< Located in the top left corner (on both ANSI
* and ISO keyboards). Produces GRAVE ACCENT and
* TILDE in a US Windows layout and in US and UK
* Mac layouts on ANSI keyboards, GRAVE ACCENT
* and NOT SIGN in a UK Windows layout, SECTION
* SIGN and PLUS-MINUS SIGN in US and UK Mac
* layouts on ISO keyboards, SECTION SIGN and
* DEGREE SIGN in a Swiss German layout (Mac:
* only on ISO keyboards), CIRCUMFLEX ACCENT and
* DEGREE SIGN in a German layout (Mac: only on
* ISO keyboards), SUPERSCRIPT TWO and TILDE in a
* French Windows layout, COMMERCIAL AT and
* NUMBER SIGN in a French Mac layout on ISO
* keyboards, and LESS-THAN SIGN and GREATER-THAN
* SIGN in a Swiss German, German, or French Mac
* layout on ANSI keyboards.
*/
FT_ScanCode_COMMA = 54,
FT_ScanCode_PERIOD = 55,
FT_ScanCode_SLASH = 56,
FT_ScanCode_CAPSLOCK = 57,
FT_ScanCode_F1 = 58,
FT_ScanCode_F2 = 59,
FT_ScanCode_F3 = 60,
FT_ScanCode_F4 = 61,
FT_ScanCode_F5 = 62,
FT_ScanCode_F6 = 63,
FT_ScanCode_F7 = 64,
FT_ScanCode_F8 = 65,
FT_ScanCode_F9 = 66,
FT_ScanCode_F10 = 67,
FT_ScanCode_F11 = 68,
FT_ScanCode_F12 = 69,
FT_ScanCode_PRINTSCREEN = 70,
FT_ScanCode_SCROLLLOCK = 71,
FT_ScanCode_PAUSE = 72,
FT_ScanCode_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
does send code 73, not 117) */
FT_ScanCode_HOME = 74,
FT_ScanCode_PAGEUP = 75,
FT_ScanCode_DELETE = 76,
FT_ScanCode_END = 77,
FT_ScanCode_PAGEDOWN = 78,
FT_ScanCode_RIGHT = 79,
FT_ScanCode_LEFT = 80,
FT_ScanCode_DOWN = 81,
FT_ScanCode_UP = 82,
FT_ScanCode_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards
*/
FT_ScanCode_KP_DIVIDE = 84,
FT_ScanCode_KP_MULTIPLY = 85,
FT_ScanCode_KP_MINUS = 86,
FT_ScanCode_KP_PLUS = 87,
FT_ScanCode_KP_ENTER = 88,
FT_ScanCode_KP_1 = 89,
FT_ScanCode_KP_2 = 90,
FT_ScanCode_KP_3 = 91,
FT_ScanCode_KP_4 = 92,
FT_ScanCode_KP_5 = 93,
FT_ScanCode_KP_6 = 94,
FT_ScanCode_KP_7 = 95,
FT_ScanCode_KP_8 = 96,
FT_ScanCode_KP_9 = 97,
FT_ScanCode_KP_0 = 98,
FT_ScanCode_KP_PERIOD = 99,
FT_ScanCode_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
* keyboards have over ANSI ones,
* located between left shift and Y.
* Produces GRAVE ACCENT and TILDE in a
* US or UK Mac layout, REVERSE SOLIDUS
* (backslash) and VERTICAL LINE in a
* US or UK Windows layout, and
* LESS-THAN SIGN and GREATER-THAN SIGN
* in a Swiss German, German, or French
* layout. */
FT_ScanCode_APPLICATION = 101, /**< windows contextual menu, compose */
FT_ScanCode_POWER = 102, /**< The USB document says this is a status flag,
* not a physical key - but some Mac keyboards
* do have a power key. */
FT_ScanCode_KP_EQUALS = 103,
FT_ScanCode_F13 = 104,
FT_ScanCode_F14 = 105,
FT_ScanCode_F15 = 106,
FT_ScanCode_F16 = 107,
FT_ScanCode_F17 = 108,
FT_ScanCode_F18 = 109,
FT_ScanCode_F19 = 110,
FT_ScanCode_F20 = 111,
FT_ScanCode_F21 = 112,
FT_ScanCode_F22 = 113,
FT_ScanCode_F23 = 114,
FT_ScanCode_F24 = 115,
FT_ScanCode_EXECUTE = 116,
FT_ScanCode_HELP = 117, /**< AL Integrated Help Center */
FT_ScanCode_MENU = 118, /**< Menu (show menu) */
FT_ScanCode_SELECT = 119,
FT_ScanCode_STOP = 120, /**< AC Stop */
FT_ScanCode_AGAIN = 121, /**< AC Redo/Repeat */
FT_ScanCode_UNDO = 122, /**< AC Undo */
FT_ScanCode_CUT = 123, /**< AC Cut */
FT_ScanCode_COPY = 124, /**< AC Copy */
FT_ScanCode_PASTE = 125, /**< AC Paste */
FT_ScanCode_FIND = 126, /**< AC Find */
FT_ScanCode_MUTE = 127,
FT_ScanCode_VOLUMEUP = 128,
FT_ScanCode_VOLUMEDOWN = 129,
/* not sure whether there's a reason to enable these */
/* FT_ScanCode_LOCKINGCAPSLOCK = 130, */
/* FT_ScanCode_LOCKINGNUMLOCK = 131, */
/* FT_ScanCode_LOCKINGSCROLLLOCK = 132, */
FT_ScanCode_KP_COMMA = 133,
FT_ScanCode_KP_EQUALSAS400 = 134,
FT_ScanCode_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see
footnotes in USB doc */
FT_ScanCode_INTERNATIONAL2 = 136,
FT_ScanCode_INTERNATIONAL3 = 137, /**< Yen */
FT_ScanCode_INTERNATIONAL4 = 138,
FT_ScanCode_INTERNATIONAL5 = 139,
FT_ScanCode_INTERNATIONAL6 = 140,
FT_ScanCode_INTERNATIONAL7 = 141,
FT_ScanCode_INTERNATIONAL8 = 142,
FT_ScanCode_INTERNATIONAL9 = 143,
FT_ScanCode_LANG1 = 144, /**< Hangul/English toggle */
FT_ScanCode_LANG2 = 145, /**< Hanja conversion */
FT_ScanCode_LANG3 = 146, /**< Katakana */
FT_ScanCode_LANG4 = 147, /**< Hiragana */
FT_ScanCode_LANG5 = 148, /**< Zenkaku/Hankaku */
FT_ScanCode_LANG6 = 149, /**< reserved */
FT_ScanCode_LANG7 = 150, /**< reserved */
FT_ScanCode_LANG8 = 151, /**< reserved */
FT_ScanCode_LANG9 = 152, /**< reserved */
FT_ScanCode_ALTERASE = 153, /**< Erase-Eaze */
FT_ScanCode_SYSREQ = 154,
FT_ScanCode_CANCEL = 155, /**< AC Cancel */
FT_ScanCode_CLEAR = 156,
FT_ScanCode_PRIOR = 157,
FT_ScanCode_RETURN2 = 158,
FT_ScanCode_SEPARATOR = 159,
FT_ScanCode_OUT = 160,
FT_ScanCode_OPER = 161,
FT_ScanCode_CLEARAGAIN = 162,
FT_ScanCode_CRSEL = 163,
FT_ScanCode_EXSEL = 164,
FT_ScanCode_KP_00 = 176,
FT_ScanCode_KP_000 = 177,
FT_ScanCode_THOUSANDSSEPARATOR = 178,
FT_ScanCode_DECIMALSEPARATOR = 179,
FT_ScanCode_CURRENCYUNIT = 180,
FT_ScanCode_CURRENCYSUBUNIT = 181,
FT_ScanCode_KP_LEFTPAREN = 182,
FT_ScanCode_KP_RIGHTPAREN = 183,
FT_ScanCode_KP_LEFTBRACE = 184,
FT_ScanCode_KP_RIGHTBRACE = 185,
FT_ScanCode_KP_TAB = 186,
FT_ScanCode_KP_BACKSPACE = 187,
FT_ScanCode_KP_A = 188,
FT_ScanCode_KP_B = 189,
FT_ScanCode_KP_C = 190,
FT_ScanCode_KP_D = 191,
FT_ScanCode_KP_E = 192,
FT_ScanCode_KP_F = 193,
FT_ScanCode_KP_XOR = 194,
FT_ScanCode_KP_POWER = 195,
FT_ScanCode_KP_PERCENT = 196,
FT_ScanCode_KP_LESS = 197,
FT_ScanCode_KP_GREATER = 198,
FT_ScanCode_KP_AMPERSAND = 199,
FT_ScanCode_KP_DBLAMPERSAND = 200,
FT_ScanCode_KP_VERTICALBAR = 201,
FT_ScanCode_KP_DBLVERTICALBAR = 202,
FT_ScanCode_KP_COLON = 203,
FT_ScanCode_KP_HASH = 204,
FT_ScanCode_KP_SPACE = 205,
FT_ScanCode_KP_AT = 206,
FT_ScanCode_KP_EXCLAM = 207,
FT_ScanCode_KP_MEMSTORE = 208,
FT_ScanCode_KP_MEMRECALL = 209,
FT_ScanCode_KP_MEMCLEAR = 210,
FT_ScanCode_KP_MEMADD = 211,
FT_ScanCode_KP_MEMSUBTRACT = 212,
FT_ScanCode_KP_MEMMULTIPLY = 213,
FT_ScanCode_KP_MEMDIVIDE = 214,
FT_ScanCode_KP_PLUSMINUS = 215,
FT_ScanCode_KP_CLEAR = 216,
FT_ScanCode_KP_CLEARENTRY = 217,
FT_ScanCode_KP_BINARY = 218,
FT_ScanCode_KP_OCTAL = 219,
FT_ScanCode_KP_DECIMAL = 220,
FT_ScanCode_KP_HEXADECIMAL = 221,
FT_ScanCode_LCTRL = 224,
FT_ScanCode_LSHIFT = 225,
FT_ScanCode_LALT = 226, /**< alt, option */
FT_ScanCode_LGUI = 227, /**< windows, command (apple), meta */
FT_ScanCode_RCTRL = 228,
FT_ScanCode_RSHIFT = 229,
FT_ScanCode_RALT = 230, /**< alt gr, option */
FT_ScanCode_RGUI = 231, /**< windows, command (apple), meta */
FT_ScanCode_MODE = 257, /**< I'm not sure if this is really not covered
* by any of the above, but since there's a
* special FT_Keymod_MODE for it I'm adding it here
*/
/* @} *//* Usage page 0x07 */
/**
* \name Usage page 0x0C
*
* These values are mapped from usage page 0x0C (USB consumer page).
* See https://usb.org/sites/default/files/hut1_2.pdf
*
* There are way more keys in the spec than we can represent in the
* current ScanCode range, so pick the ones that commonly come up in
* real world usage.
*/
/* @{ */
FT_ScanCode_AUDIONEXT = 258,
FT_ScanCode_AUDIOPREV = 259,
FT_ScanCode_AUDIOSTOP = 260,
FT_ScanCode_AUDIOPLAY = 261,
FT_ScanCode_AUDIOMUTE = 262,
FT_ScanCode_MEDIASELECT = 263,
FT_ScanCode_WWW = 264, /**< AL Internet Browser */
FT_ScanCode_MAIL = 265,
FT_ScanCode_CALCULATOR = 266, /**< AL Calculator */
FT_ScanCode_COMPUTER = 267,
FT_ScanCode_AC_SEARCH = 268, /**< AC Search */
FT_ScanCode_AC_HOME = 269, /**< AC Home */
FT_ScanCode_AC_BACK = 270, /**< AC Back */
FT_ScanCode_AC_FORWARD = 271, /**< AC Forward */
FT_ScanCode_AC_STOP = 272, /**< AC Stop */
FT_ScanCode_AC_REFRESH = 273, /**< AC Refresh */
FT_ScanCode_AC_BOOKMARKS = 274, /**< AC Bookmarks */
/* @} *//* Usage page 0x0C */
/**
* \name Walther keys
*
* These are values that Christian Walther added (for mac keyboard?).
*/
/* @{ */
FT_ScanCode_BRIGHTNESSDOWN = 275,
FT_ScanCode_BRIGHTNESSUP = 276,
FT_ScanCode_DISPLAYSWITCH = 277, /**< display mirroring/dual display
switch, video mode switch */
FT_ScanCode_KBDILLUMTOGGLE = 278,
FT_ScanCode_KBDILLUMDOWN = 279,
FT_ScanCode_KBDILLUMUP = 280,
FT_ScanCode_EJECT = 281,
FT_ScanCode_SLEEP = 282, /**< SC System Sleep */
FT_ScanCode_APP1 = 283,
FT_ScanCode_APP2 = 284,
/* @} *//* Walther keys */
/**
* \name Usage page 0x0C (additional media keys)
*
* These values are mapped from usage page 0x0C (USB consumer page).
*/
/* @{ */
FT_ScanCode_AUDIOREWIND = 285,
FT_ScanCode_AUDIOFASTFORWARD = 286,
/* @} *//* Usage page 0x0C (additional media keys) */
/**
* \name Mobile keys
*
* These are values that are often used on mobile phones.
*/
/* @{ */
FT_ScanCode_SOFTLEFT = 287, /**< Usually situated below the display on phones and
used as a multi-function feature key for selecting
a software defined function shown on the bottom left
of the display. */
FT_ScanCode_SOFTRIGHT = 288, /**< Usually situated below the display on phones and
used as a multi-function feature key for selecting
a software defined function shown on the bottom right
of the display. */
FT_ScanCode_CALL = 289, /**< Used for accepting phone calls. */
FT_ScanCode_ENDCALL = 290, /**< Used for rejecting phone calls. */
/* @} *//* Mobile keys */
/* Add any other keys here. */
FT_NUM_ScanCodeS = 512 /**< not a key, just marks the number of ScanCodes
for array bounds */
} FT_ScanCode;
enum
{
FT_Key_UNKNOWN = 0,
FT_Key_RETURN = '\r',
FT_Key_ESCAPE = '\x1B',
FT_Key_BACKSPACE = '\b',
FT_Key_TAB = '\t',
FT_Key_SPACE = ' ',
FT_Key_EXCLAIM = '!',
FT_Key_QUOTEDBL = '"',
FT_Key_HASH = '#',
FT_Key_PERCENT = '%',
FT_Key_DOLLAR = '$',
FT_Key_AMPERSAND = '&',
FT_Key_QUOTE = '\'',
FT_Key_LEFTPAREN = '(',
FT_Key_RIGHTPAREN = ')',
FT_Key_ASTERISK = '*',
FT_Key_PLUS = '+',
FT_Key_COMMA = ',',
FT_Key_MINUS = '-',
FT_Key_PERIOD = '.',
FT_Key_SLASH = '/',
FT_Key_0 = '0',
FT_Key_1 = '1',
FT_Key_2 = '2',
FT_Key_3 = '3',
FT_Key_4 = '4',
FT_Key_5 = '5',
FT_Key_6 = '6',
FT_Key_7 = '7',
FT_Key_8 = '8',
FT_Key_9 = '9',
FT_Key_COLON = ':',
FT_Key_SEMICOLON = ';',
FT_Key_LESS = '<',
FT_Key_EQUALS = '=',
FT_Key_GREATER = '>',
FT_Key_QUESTION = '?',
FT_Key_AT = '@',
/*
Skip uppercase letters
*/
FT_Key_LEFTBRACKET = '[',
FT_Key_BACKSLASH = '\\',
FT_Key_RIGHTBRACKET = ']',
FT_Key_CARET = '^',
FT_Key_UNDERSCORE = '_',
FT_Key_BACKQUOTE = '`',
FT_Key_a = 'a',
FT_Key_b = 'b',
FT_Key_c = 'c',
FT_Key_d = 'd',
FT_Key_e = 'e',
FT_Key_f = 'f',
FT_Key_g = 'g',
FT_Key_h = 'h',
FT_Key_i = 'i',
FT_Key_j = 'j',
FT_Key_k = 'k',
FT_Key_l = 'l',
FT_Key_m = 'm',
FT_Key_n = 'n',
FT_Key_o = 'o',
FT_Key_p = 'p',
FT_Key_q = 'q',
FT_Key_r = 'r',
FT_Key_s = 's',
FT_Key_t = 't',
FT_Key_u = 'u',
FT_Key_v = 'v',
FT_Key_w = 'w',
FT_Key_x = 'x',
FT_Key_y = 'y',
FT_Key_z = 'z',
FT_Key_CAPSLOCK = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CAPSLOCK),
FT_Key_F1 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F1),
FT_Key_F2 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F2),
FT_Key_F3 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F3),
FT_Key_F4 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F4),
FT_Key_F5 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F5),
FT_Key_F6 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F6),
FT_Key_F7 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F7),
FT_Key_F8 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F8),
FT_Key_F9 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F9),
FT_Key_F10 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F10),
FT_Key_F11 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F11),
FT_Key_F12 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F12),
FT_Key_PRINTSCREEN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_PRINTSCREEN),
FT_Key_SCROLLLOCK = FT_ScanCode_TO_KEYCODE(FT_ScanCode_SCROLLLOCK),
FT_Key_PAUSE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_PAUSE),
FT_Key_INSERT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_INSERT),
FT_Key_HOME = FT_ScanCode_TO_KEYCODE(FT_ScanCode_HOME),
FT_Key_PAGEUP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_PAGEUP),
FT_Key_DELETE = '\x7F',
FT_Key_END = FT_ScanCode_TO_KEYCODE(FT_ScanCode_END),
FT_Key_PAGEDOWN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_PAGEDOWN),
FT_Key_RIGHT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_RIGHT),
FT_Key_LEFT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_LEFT),
FT_Key_DOWN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_DOWN),
FT_Key_UP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_UP),
FT_Key_NUMLOCKCLEAR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_NUMLOCKCLEAR),
FT_Key_KP_DIVIDE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_DIVIDE),
FT_Key_KP_MULTIPLY = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_MULTIPLY),
FT_Key_KP_MINUS = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_MINUS),
FT_Key_KP_PLUS = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_PLUS),
FT_Key_KP_ENTER = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_ENTER),
FT_Key_KP_1 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_1),
FT_Key_KP_2 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_2),
FT_Key_KP_3 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_3),
FT_Key_KP_4 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_4),
FT_Key_KP_5 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_5),
FT_Key_KP_6 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_6),
FT_Key_KP_7 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_7),
FT_Key_KP_8 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_8),
FT_Key_KP_9 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_9),
FT_Key_KP_0 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_0),
FT_Key_KP_PERIOD = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_PERIOD),
FT_Key_APPLICATION = FT_ScanCode_TO_KEYCODE(FT_ScanCode_APPLICATION),
FT_Key_POWER = FT_ScanCode_TO_KEYCODE(FT_ScanCode_POWER),
FT_Key_KP_EQUALS = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_EQUALS),
FT_Key_F13 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F13),
FT_Key_F14 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F14),
FT_Key_F15 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F15),
FT_Key_F16 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F16),
FT_Key_F17 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F17),
FT_Key_F18 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F18),
FT_Key_F19 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F19),
FT_Key_F20 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F20),
FT_Key_F21 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F21),
FT_Key_F22 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F22),
FT_Key_F23 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F23),
FT_Key_F24 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_F24),
FT_Key_EXECUTE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_EXECUTE),
FT_Key_HELP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_HELP),
FT_Key_MENU = FT_ScanCode_TO_KEYCODE(FT_ScanCode_MENU),
FT_Key_SELECT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_SELECT),
FT_Key_STOP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_STOP),
FT_Key_AGAIN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AGAIN),
FT_Key_UNDO = FT_ScanCode_TO_KEYCODE(FT_ScanCode_UNDO),
FT_Key_CUT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CUT),
FT_Key_COPY = FT_ScanCode_TO_KEYCODE(FT_ScanCode_COPY),
FT_Key_PASTE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_PASTE),
FT_Key_FIND = FT_ScanCode_TO_KEYCODE(FT_ScanCode_FIND),
FT_Key_MUTE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_MUTE),
FT_Key_VOLUMEUP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_VOLUMEUP),
FT_Key_VOLUMEDOWN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_VOLUMEDOWN),
FT_Key_KP_COMMA = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_COMMA),
FT_Key_KP_EQUALSAS400 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_EQUALSAS400),
FT_Key_ALTERASE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_ALTERASE),
FT_Key_SYSREQ = FT_ScanCode_TO_KEYCODE(FT_ScanCode_SYSREQ),
FT_Key_CANCEL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CANCEL),
FT_Key_CLEAR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CLEAR),
FT_Key_PRIOR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_PRIOR),
FT_Key_RETURN2 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_RETURN2),
FT_Key_SEPARATOR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_SEPARATOR),
FT_Key_OUT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_OUT),
FT_Key_OPER = FT_ScanCode_TO_KEYCODE(FT_ScanCode_OPER),
FT_Key_CLEARAGAIN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CLEARAGAIN),
FT_Key_CRSEL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CRSEL),
FT_Key_EXSEL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_EXSEL),
FT_Key_KP_00 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_00),
FT_Key_KP_000 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_000),
FT_Key_THOUSANDSSEPARATOR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_THOUSANDSSEPARATOR),
FT_Key_DECIMALSEPARATOR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_DECIMALSEPARATOR),
FT_Key_CURRENCYUNIT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CURRENCYUNIT),
FT_Key_CURRENCYSUBUNIT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CURRENCYSUBUNIT),
FT_Key_KP_LEFTPAREN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_LEFTPAREN),
FT_Key_KP_RIGHTPAREN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_RIGHTPAREN),
FT_Key_KP_LEFTBRACE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_LEFTBRACE),
FT_Key_KP_RIGHTBRACE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_RIGHTBRACE),
FT_Key_KP_TAB = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_TAB),
FT_Key_KP_BACKSPACE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_BACKSPACE),
FT_Key_KP_A = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_A),
FT_Key_KP_B = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_B),
FT_Key_KP_C = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_C),
FT_Key_KP_D = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_D),
FT_Key_KP_E = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_E),
FT_Key_KP_F = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_F),
FT_Key_KP_XOR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_XOR),
FT_Key_KP_POWER = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_POWER),
FT_Key_KP_PERCENT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_PERCENT),
FT_Key_KP_LESS = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_LESS),
FT_Key_KP_GREATER = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_GREATER),
FT_Key_KP_AMPERSAND = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_AMPERSAND),
FT_Key_KP_DBLAMPERSAND = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_DBLAMPERSAND),
FT_Key_KP_VERTICALBAR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_VERTICALBAR),
FT_Key_KP_DBLVERTICALBAR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_DBLVERTICALBAR),
FT_Key_KP_COLON = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_COLON),
FT_Key_KP_HASH = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_HASH),
FT_Key_KP_SPACE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_SPACE),
FT_Key_KP_AT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_AT),
FT_Key_KP_EXCLAM = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_EXCLAM),
FT_Key_KP_MEMSTORE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_MEMSTORE),
FT_Key_KP_MEMRECALL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_MEMRECALL),
FT_Key_KP_MEMCLEAR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_MEMCLEAR),
FT_Key_KP_MEMADD = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_MEMADD),
FT_Key_KP_MEMSUBTRACT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_MEMSUBTRACT),
FT_Key_KP_MEMMULTIPLY = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_MEMMULTIPLY),
FT_Key_KP_MEMDIVIDE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_MEMDIVIDE),
FT_Key_KP_PLUSMINUS = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_PLUSMINUS),
FT_Key_KP_CLEAR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_CLEAR),
FT_Key_KP_CLEARENTRY = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_CLEARENTRY),
FT_Key_KP_BINARY = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_BINARY),
FT_Key_KP_OCTAL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_OCTAL),
FT_Key_KP_DECIMAL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_DECIMAL),
FT_Key_KP_HEXADECIMAL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KP_HEXADECIMAL),
FT_Key_LCTRL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_LCTRL),
FT_Key_LSHIFT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_LSHIFT),
FT_Key_LALT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_LALT),
FT_Key_LGUI = FT_ScanCode_TO_KEYCODE(FT_ScanCode_LGUI),
FT_Key_RCTRL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_RCTRL),
FT_Key_RSHIFT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_RSHIFT),
FT_Key_RALT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_RALT),
FT_Key_RGUI = FT_ScanCode_TO_KEYCODE(FT_ScanCode_RGUI),
FT_Key_MODE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_MODE),
FT_Key_AUDIONEXT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AUDIONEXT),
FT_Key_AUDIOPREV = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AUDIOPREV),
FT_Key_AUDIOSTOP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AUDIOSTOP),
FT_Key_AUDIOPLAY = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AUDIOPLAY),
FT_Key_AUDIOMUTE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AUDIOMUTE),
FT_Key_MEDIASELECT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_MEDIASELECT),
FT_Key_WWW = FT_ScanCode_TO_KEYCODE(FT_ScanCode_WWW),
FT_Key_MAIL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_MAIL),
FT_Key_CALCULATOR = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CALCULATOR),
FT_Key_COMPUTER = FT_ScanCode_TO_KEYCODE(FT_ScanCode_COMPUTER),
FT_Key_AC_SEARCH = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AC_SEARCH),
FT_Key_AC_HOME = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AC_HOME),
FT_Key_AC_BACK = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AC_BACK),
FT_Key_AC_FORWARD = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AC_FORWARD),
FT_Key_AC_STOP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AC_STOP),
FT_Key_AC_REFRESH = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AC_REFRESH),
FT_Key_AC_BOOKMARKS = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AC_BOOKMARKS),
FT_Key_BRIGHTNESSDOWN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_BRIGHTNESSDOWN),
FT_Key_BRIGHTNESSUP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_BRIGHTNESSUP),
FT_Key_DISPLAYSWITCH = FT_ScanCode_TO_KEYCODE(FT_ScanCode_DISPLAYSWITCH),
FT_Key_KBDILLUMTOGGLE = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KBDILLUMTOGGLE),
FT_Key_KBDILLUMDOWN = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KBDILLUMDOWN),
FT_Key_KBDILLUMUP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_KBDILLUMUP),
FT_Key_EJECT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_EJECT),
FT_Key_SLEEP = FT_ScanCode_TO_KEYCODE(FT_ScanCode_SLEEP),
FT_Key_APP1 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_APP1),
FT_Key_APP2 = FT_ScanCode_TO_KEYCODE(FT_ScanCode_APP2),
FT_Key_AUDIOREWIND = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AUDIOREWIND),
FT_Key_AUDIOFASTFORWARD = FT_ScanCode_TO_KEYCODE(FT_ScanCode_AUDIOFASTFORWARD),
FT_Key_SOFTLEFT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_SOFTLEFT),
FT_Key_SOFTRIGHT = FT_ScanCode_TO_KEYCODE(FT_ScanCode_SOFTRIGHT),
FT_Key_CALL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_CALL),
FT_Key_ENDCALL = FT_ScanCode_TO_KEYCODE(FT_ScanCode_ENDCALL)
};
typedef I32 FT_Keycode;
/**
* \brief Enumeration of valid key mods (possibly OR'd together).
*/
enum
{
FT_Keymod_NONE = 0x0000,
FT_Keymod_LSHIFT = 0x0001,
FT_Keymod_RSHIFT = 0x0002,
FT_Keymod_LCTRL = 0x0040,
FT_Keymod_RCTRL = 0x0080,
FT_Keymod_LALT = 0x0100,
FT_Keymod_RALT = 0x0200,
FT_Keymod_LGUI = 0x0400,
FT_Keymod_RGUI = 0x0800,
FT_Keymod_NUM = 0x1000,
FT_Keymod_CAPS = 0x2000,
FT_Keymod_MODE = 0x4000,
FT_Keymod_SCROLL = 0x8000,
FT_Keymod_CTRL = FT_Keymod_LCTRL | FT_Keymod_RCTRL,
FT_Keymod_SHIFT = FT_Keymod_LSHIFT | FT_Keymod_RSHIFT,
FT_Keymod_ALT = FT_Keymod_LALT | FT_Keymod_RALT,
FT_Keymod_GUI = FT_Keymod_LGUI | FT_Keymod_RGUI,
FT_Keymod_RESERVED = FT_Keymod_SCROLL /* This is for source-level compatibility with FT 1.0.0. */
};
typedef I32 FT_Keymod;
/** States for input devices*/
enum
{
FT_INDEV_STATE_RELEASED = 0,
FT_INDEV_STATE_PRESSED
};
//===============================FT==========================================FT==========================================FT==========================================
//===============================FT==========================================FT==========================================FT==========================================
FT_Def_Enum FT_KeyPos_State{
FT_KeyPos_Idel,
FT_KeyPos_Down,
FT_KeyPos_Move,
FT_KeyPos_Click,
FT_KeyPos_UP,
FT_KeyPos_Wheel,
FT_KeyPos_Wheeling,
FT_KeyPos_WheelEnd,
FT_KeyPos_End,
FT_KeyPos_Cancel,
} FT_KeyPos_State;
FT_Def_StructStart(FT_KeyPos)
{
Str tag;
Bool key;//active 1 or 0
Bool mouse;//active 1 or 0
Bool wheel;//active 1 or 0
Bool intercepted;
FT_KeyPos_State state;
I32 keycode;
I32 keymod;
I32 keyscan;
I32 depth;
U32 clicks;
U32 timing;
FT_XY peek;//used for wheel....
FT_XY pos;
FT_XY delta;
Void (*onAction)(Any keypos);
}
FT_Def_StructStop(FT_KeyPos);
#define FT_KeyPosP &(FT_KeyPosT)
#endif /* _FT_KeyCode_h_ */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ft-ink/ft_dev.git
[email protected]:ft-ink/ft_dev.git
ft-ink
ft_dev
ft_dev
main

搜索帮助