88 #define KEYCODE_NONE 0x0000 89 #define KEYCODE_ESC 0x0001 90 #define KEYCODE_1 0x0002 91 #define KEYCODE_2 0x0003 92 #define KEYCODE_3 0x0004 93 #define KEYCODE_4 0x0005 94 #define KEYCODE_5 0x0006 95 #define KEYCODE_6 0x0007 96 #define KEYCODE_7 0x0008 97 #define KEYCODE_8 0x0009 98 #define KEYCODE_9 0x000A 99 #define KEYCODE_0 0x000B 100 #define KEYCODE_MINUS 0x000C 101 #define KEYCODE_EQUAL 0x000D 102 #define KEYCODE_BACKSPACE 0x000E 103 #define KEYCODE_TAB 0x000F 104 #define KEYCODE_Q 0x0010 105 #define KEYCODE_W 0x0011 106 #define KEYCODE_E 0x0012 107 #define KEYCODE_R 0x0013 108 #define KEYCODE_T 0x0014 109 #define KEYCODE_Y 0x0015 110 #define KEYCODE_U 0x0016 111 #define KEYCODE_I 0x0017 112 #define KEYCODE_O 0x0018 113 #define KEYCODE_P 0x0019 114 #define KEYCODE_LEFTBRACE 0x001A 115 #define KEYCODE_RIGHTBRACE 0x001B 116 #define KEYCODE_ENTER 0x001C 117 #define KEYCODE_LEFTCTRL 0x001D 118 #define KEYCODE_A 0x001E 119 #define KEYCODE_S 0x001F 120 #define KEYCODE_D 0x0020 121 #define KEYCODE_F 0x0021 122 #define KEYCODE_G 0x0022 123 #define KEYCODE_H 0x0023 124 #define KEYCODE_J 0x0024 125 #define KEYCODE_K 0x0025 126 #define KEYCODE_L 0x0026 127 #define KEYCODE_SEMICOLON 0x0027 128 #define KEYCODE_APOSTROPHE 0x0028 129 #define KEYCODE_GRAVE 0x0029 130 #define KEYCODE_LEFTSHIFT 0x002A 131 #define KEYCODE_BACKSLASH 0x002B 132 #define KEYCODE_Z 0x002C 133 #define KEYCODE_X 0x002D 134 #define KEYCODE_C 0x002E 135 #define KEYCODE_V 0x002F 136 #define KEYCODE_B 0x0030 137 #define KEYCODE_N 0x0031 138 #define KEYCODE_M 0x0032 139 #define KEYCODE_COMMA 0x0033 140 #define KEYCODE_DOT 0x0034 141 #define KEYCODE_SLASH 0x0035 142 #define KEYCODE_RIGHTSHIFT 0x0036 143 #define KEYCODE_KPASTERISK 0x0037 144 #define KEYCODE_LEFTALT 0x0038 145 #define KEYCODE_SPACE 0x0039 146 #define KEYCODE_CAPSLOCK 0x003A 147 #define KEYCODE_F1 0x003B 148 #define KEYCODE_F2 0x003C 149 #define KEYCODE_F3 0x003D 150 #define KEYCODE_F4 0x003E 151 #define KEYCODE_F5 0x003F 152 #define KEYCODE_F6 0x0040 153 #define KEYCODE_F7 0x0041 154 #define KEYCODE_F8 0x0042 155 #define KEYCODE_F9 0x0043 156 #define KEYCODE_F10 0x0044 157 #define KEYCODE_NUMLOCK 0x0045 158 #define KEYCODE_SCROLLLOCK 0x0046 159 #define KEYCODE_KP7 0x0047 160 #define KEYCODE_KP8 0x0048 161 #define KEYCODE_KP9 0x0049 162 #define KEYCODE_KPMINUS 0x004A 163 #define KEYCODE_KP4 0x004B 164 #define KEYCODE_KP5 0x004C 165 #define KEYCODE_KP6 0x004D 166 #define KEYCODE_KPPLUS 0x004E 167 #define KEYCODE_KP1 0x004F 168 #define KEYCODE_KP2 0x0050 169 #define KEYCODE_KP3 0x0051 170 #define KEYCODE_KP0 0x0052 171 #define KEYCODE_KPDOT 0x0053 172 #define KEYCODE_F11 0x0057 173 #define KEYCODE_F12 0x0058 174 #define KEYCODE_KPENTER 0x0060 175 #define KEYCODE_RIGHTCTRL 0x0061 176 #define KEYCODE_KPSLASH 0x0062 177 #define KEYCODE_SYSRQ 0x0063 178 #define KEYCODE_RIGHTALT 0x0064 179 #define KEYCODE_LINEFEED 0x0065 180 #define KEYCODE_HOME 0x0066 181 #define KEYCODE_UP 0x0067 182 #define KEYCODE_PAGEUP 0x0068 183 #define KEYCODE_LEFT 0x0069 184 #define KEYCODE_RIGHT 0x006A 185 #define KEYCODE_END 0x006B 186 #define KEYCODE_DOWN 0x006C 187 #define KEYCODE_PAGEDOWN 0x006D 188 #define KEYCODE_INSERT 0x006E 189 #define KEYCODE_DELETE 0x006F 190 #define KEYCODE_MACRO 0x0070 191 #define KEYCODE_MUTE 0x0071 192 #define KEYCODE_VOLUMEDOWN 0x0072 193 #define KEYCODE_VOLUMEUP 0x0073 194 #define KEYCODE_POWER 0x0074 195 #define KEYCODE_KPEQUAL 0x0075 196 #define KEYCODE_KPPLUSMINUS 0x0076 197 #define KEYCODE_KPCOMMA 0x0079 198 #define KEYCODE_LEFTMETA 0x007D 199 #define KEYCODE_RIGHTMETA 0x007E 200 #define KEYCODE_SLEEP 0x008E 201 #define KEYCODE_WAKEUP 0x008F 202 #define KEYCODE_KPLEFTPAREN 0x00B3 203 #define KEYCODE_KPRIGHTPAREN 0x00B4 204 #define KEYCODE_F13 0x00B7 205 #define KEYCODE_F14 0x00B8 206 #define KEYCODE_F15 0x00B9 207 #define KEYCODE_F16 0x00BA 208 #define KEYCODE_F17 0x00BB 209 #define KEYCODE_F18 0x00BC 210 #define KEYCODE_F19 0x00BD 211 #define KEYCODE_F20 0x00BE 212 #define KEYCODE_F21 0x00BF 213 #define KEYCODE_F22 0x00C0 214 #define KEYCODE_F23 0x00C1 215 #define KEYCODE_F24 0x00C2 216 #define KEYCODE_CLOSE 0x00CE 217 #define KEYCODE_PLAY 0x00CF 218 #define KEYCODE_PRINT 0x00D2 219 #define KEYCODE_SEARCH 0x00D9 220 #define KEYCODE_CANCEL 0x00DF 221 #define KEYCODE_BRIGHTNESS_DOWN 0x00E0 222 #define KEYCODE_BRIGHTNESS_UP 0x00E1 223 #define KEYCODE_BRIGHTNESS_CYCLE 0x00F3 224 #define KEYCODE_BRIGHTNESS_AUTO 0x00F4 225 #define KEYCODE_BTN0 0x0100 226 #define KEYCODE_BTN1 0x0101 227 #define KEYCODE_BTN2 0x0102 228 #define KEYCODE_BTN3 0x0103 229 #define KEYCODE_BTN4 0x0104 230 #define KEYCODE_BTN5 0x0105 231 #define KEYCODE_BTN6 0x0106 232 #define KEYCODE_BTN7 0x0107 233 #define KEYCODE_BTN8 0x0108 234 #define KEYCODE_BTN9 0x0109 235 #define KEYCODE_BTNLEFT 0x0110 236 #define KEYCODE_BTNRIGHT 0x0111 237 #define KEYCODE_BTNMIDDLE 0x0112 238 #define KEYCODE_BTNSIDE 0x0113 239 #define KEYCODE_BTNEXTRA 0x0114 240 #define KEYCODE_BTNTOUCH 0x014A 241 #define KEYCODE_EJECT 0x0200 242 #define KEYCODE_POWER_OFF 0x0201 243 #define KEYCODE_POWER_ON 0x0202 244 #define KEYCODE_INPUT_SELECT 0x0203 245 #define KEYCODE_INPUT_PC 0x0204 246 #define KEYCODE_INPUT_VIDEO1 0x0205 247 #define KEYCODE_INPUT_VIDEO2 0x0206 248 #define KEYCODE_INPUT_VIDEO3 0x0207 249 #define KEYCODE_INPUT_VIDEO4 0x0208 250 #define KEYCODE_INPUT_VIDEO5 0x0209 251 #define KEYCODE_INPUT_HDMI1 0x020A 252 #define KEYCODE_INPUT_HDMI2 0x020B 253 #define KEYCODE_INPUT_HDMI3 0x020C 254 #define KEYCODE_INPUT_HDMI4 0x020D 255 #define KEYCODE_INPUT_HDMI5 0x020E 256 #define KEYCODE_INPUT_AUX1 0x020F 257 #define KEYCODE_INPUT_AUX2 0x0210 258 #define KEYCODE_INPUT_AUX3 0x0211 259 #define KEYCODE_INPUT_AUX4 0x0212 260 #define KEYCODE_INPUT_AUX5 0x0213 261 #define KEYCODE_INPUT_CD 0x0214 262 #define KEYCODE_INPUT_DVD 0x0215 263 #define KEYCODE_INPUT_PHONO 0x0216 264 #define KEYCODE_INPUT_TAPE1 0x0217 265 #define KEYCODE_INPUT_TAPE2 0x0218 266 #define KEYCODE_INPUT_TUNER 0x0219 267 #define KEYCODE_INPUT_ANALOG 0x021A 268 #define KEYCODE_INPUT_DIGITAL 0x021B 269 #define KEYCODE_INPUT_INTERNET 0x021C 270 #define KEYCODE_INPUT_TEXT 0x021D 271 #define KEYCODE_INPUT_NEXT 0x021E 272 #define KEYCODE_INPUT_PREV 0x021F 273 #define KEYCODE_VIDEO_ASPECT 0x0220 274 #define KEYCODE_VIDEO_PIP 0x0221 275 #define KEYCODE_AUDIO_MONITOR 0x0222 276 #define KEYCODE_CLEAR 0x0223 277 #define KEYCODE_TIMER 0x0224 278 #define KEYCODE_CHANNEL_PREV 0x0225 279 #define KEYCODE_CHANNEL_GUIDE 0x0226 280 #define KEYCODE_RECORD 0x0227 281 #define KEYCODE_RECORD_SPEED 0x0228 282 #define KEYCODE_PLAY_SPEED 0x0229 283 #define KEYCODE_PLAY_MODE 0x022A 284 #define KEYCODE_REPLAY 0x022B 285 #define KEYCODE_DISPLAY 0x022C 286 #define KEYCODE_MENU 0x022D 287 #define KEYCODE_INFO 0x022E 288 #define KEYCODE_THUMBS_UP 0x022F 289 #define KEYCODE_THUMBS_DOWN 0x0230 290 #define KEYCODE_FAVOURITE 0x0231 291 #define KEYCODE_BUTTON_RED 0x0232 292 #define KEYCODE_BUTTON_GREEN 0x0233 293 #define KEYCODE_BUTTON_YELLOW 0x0234 294 #define KEYCODE_BUTTON_BLUE 0x0235 295 #define KEYCODE_SEARCH_LEFT 0x0236 296 #define KEYCODE_SEARCH_RIGHT 0x0237 297 #define KEYCODE_CHAPTER_NEXT 0x0238 298 #define KEYCODE_CHAPTER_PREV 0x0239 299 #define KEYCODE_NAV_SELECT 0x023A 300 #define KEYCODE_SUBTITLE_TOGGLE 0x023B 301 #define KEYCODE_SUBTITLE_ON 0x023C 302 #define KEYCODE_SUBTITLE_OFF 0x023D 303 #define KEYCODE_STOP 0x023E 304 #define KEYCODE_PAUSE 0x023F 305 #define KEYCODE_BROWSE 0x0240 306 #define KEYCODE_SHUFFLE 0x0241 307 #define KEYCODE_REPEAT 0x0242 308 #define KEYCODE_KEYPAD_10PLUS 0x0243 309 #define KEYCODE_BUTTON_USER 0x0244 353 case KEYCODE_LEFTCTRL:
355 case KEYCODE_RIGHTCTRL:
357 case KEYCODE_LEFTSHIFT:
359 case KEYCODE_RIGHTSHIFT:
361 case KEYCODE_LEFTALT:
363 case KEYCODE_RIGHTALT:
365 case KEYCODE_LEFTMETA:
367 case KEYCODE_RIGHTMETA:
369 case KEYCODE_CAPSLOCK:
371 case KEYCODE_NUMLOCK:
373 case KEYCODE_SCROLLLOCK:
432 case KEYCODE_LEFTBRACE:
434 case KEYCODE_RIGHTBRACE:
456 case KEYCODE_SEMICOLON:
458 case KEYCODE_APOSTROPHE:
462 case KEYCODE_BACKSLASH:
484 case KEYCODE_KPASTERISK:
494 case KEYCODE_KPMINUS:
514 case KEYCODE_KPENTER:
516 case KEYCODE_KPSLASH:
518 case KEYCODE_LINEFEED:
520 case KEYCODE_KPCOMMA:
522 case KEYCODE_KPLEFTPAREN:
524 case KEYCODE_KPRIGHTPAREN:
Function key or mode modifier is active.
Alias for hid_state_off; used to indicate a falling edge.
Num Lock state is active.
const char * hid_keycode_to_string(uint16_t keycode)
Convert a keycode to a display string.
Key/button is currently released (logical off).
hid_state_t
Input state flags used by the input manager and key handling.
Convenience mask: either left or right Windows/Meta.
Right Windows/Meta modifier is active.
A repeated key/button event (auto-repeat).
static char hid_keycode_to_char(uint16_t keycode)
Convert a keycode to its one-byte character representation.
Left Option/Alt modifier is active.
Convenience mask: either left or right Shift.
Key/button is currently pressed (logical.
Convenience mask: either left or right Control.
A long-press (long click) event was generated.
Scroll Lock state is active.
Right Meta (Command) modifier is active.
Right Control modifier is active.
Caps Lock state is active.
static hid_state_t hid_keycode_to_state(uint16_t keycode)
Convert a keycode to modifier/input state flags.
size_t hid_state_to_string(hid_state_t state, char *buf, size_t buf_size)
Format a HID state bitmask as a "|"-separated list of active flag names (for example "on|left_shift")...
Right Shift modifier is active.
Left Shift modifier is active.
Convenience mask: either left or right Meta (Command).
Alias for hid_state_on; used to indicate a rising edge.
Right Option/Alt modifier is active.
Left Control modifier is active.
Left Windows/Meta modifier is active.
A double-click event was generated.
Left Meta (Command) modifier is active.
A single click event was generated.
Convenience mask: either left or right Alt (Option).
A triple-click event was generated.