81 #define KEYCODE_NONE 0x0000 82 #define KEYCODE_ESC 0x0001 83 #define KEYCODE_1 0x0002 84 #define KEYCODE_2 0x0003 85 #define KEYCODE_3 0x0004 86 #define KEYCODE_4 0x0005 87 #define KEYCODE_5 0x0006 88 #define KEYCODE_6 0x0007 89 #define KEYCODE_7 0x0008 90 #define KEYCODE_8 0x0009 91 #define KEYCODE_9 0x000A 92 #define KEYCODE_0 0x000B 93 #define KEYCODE_MINUS 0x000C 94 #define KEYCODE_EQUAL 0x000D 95 #define KEYCODE_BACKSPACE 0x000E 96 #define KEYCODE_TAB 0x000F 97 #define KEYCODE_Q 0x0010 98 #define KEYCODE_W 0x0011 99 #define KEYCODE_E 0x0012 100 #define KEYCODE_R 0x0013 101 #define KEYCODE_T 0x0014 102 #define KEYCODE_Y 0x0015 103 #define KEYCODE_U 0x0016 104 #define KEYCODE_I 0x0017 105 #define KEYCODE_O 0x0018 106 #define KEYCODE_P 0x0019 107 #define KEYCODE_LEFTBRACE 0x001A 108 #define KEYCODE_RIGHTBRACE 0x001B 109 #define KEYCODE_ENTER 0x001C 110 #define KEYCODE_LEFTCTRL 0x001D 111 #define KEYCODE_A 0x001E 112 #define KEYCODE_S 0x001F 113 #define KEYCODE_D 0x0020 114 #define KEYCODE_F 0x0021 115 #define KEYCODE_G 0x0022 116 #define KEYCODE_H 0x0023 117 #define KEYCODE_J 0x0024 118 #define KEYCODE_K 0x0025 119 #define KEYCODE_L 0x0026 120 #define KEYCODE_SEMICOLON 0x0027 121 #define KEYCODE_APOSTROPHE 0x0028 122 #define KEYCODE_GRAVE 0x0029 123 #define KEYCODE_LEFTSHIFT 0x002A 124 #define KEYCODE_BACKSLASH 0x002B 125 #define KEYCODE_Z 0x002C 126 #define KEYCODE_X 0x002D 127 #define KEYCODE_C 0x002E 128 #define KEYCODE_V 0x002F 129 #define KEYCODE_B 0x0030 130 #define KEYCODE_N 0x0031 131 #define KEYCODE_M 0x0032 132 #define KEYCODE_COMMA 0x0033 133 #define KEYCODE_DOT 0x0034 134 #define KEYCODE_SLASH 0x0035 135 #define KEYCODE_RIGHTSHIFT 0x0036 136 #define KEYCODE_KPASTERISK 0x0037 137 #define KEYCODE_LEFTALT 0x0038 138 #define KEYCODE_SPACE 0x0039 139 #define KEYCODE_CAPSLOCK 0x003A 140 #define KEYCODE_F1 0x003B 141 #define KEYCODE_F2 0x003C 142 #define KEYCODE_F3 0x003D 143 #define KEYCODE_F4 0x003E 144 #define KEYCODE_F5 0x003F 145 #define KEYCODE_F6 0x0040 146 #define KEYCODE_F7 0x0041 147 #define KEYCODE_F8 0x0042 148 #define KEYCODE_F9 0x0043 149 #define KEYCODE_F10 0x0044 150 #define KEYCODE_NUMLOCK 0x0045 151 #define KEYCODE_SCROLLLOCK 0x0046 152 #define KEYCODE_KP7 0x0047 153 #define KEYCODE_KP8 0x0048 154 #define KEYCODE_KP9 0x0049 155 #define KEYCODE_KPMINUS 0x004A 156 #define KEYCODE_KP4 0x004B 157 #define KEYCODE_KP5 0x004C 158 #define KEYCODE_KP6 0x004D 159 #define KEYCODE_KPPLUS 0x004E 160 #define KEYCODE_KP1 0x004F 161 #define KEYCODE_KP2 0x0050 162 #define KEYCODE_KP3 0x0051 163 #define KEYCODE_KP0 0x0052 164 #define KEYCODE_KPDOT 0x0053 165 #define KEYCODE_F11 0x0057 166 #define KEYCODE_F12 0x0058 167 #define KEYCODE_KPENTER 0x0060 168 #define KEYCODE_RIGHTCTRL 0x0061 169 #define KEYCODE_KPSLASH 0x0062 170 #define KEYCODE_SYSRQ 0x0063 171 #define KEYCODE_RIGHTALT 0x0064 172 #define KEYCODE_LINEFEED 0x0065 173 #define KEYCODE_HOME 0x0066 174 #define KEYCODE_UP 0x0067 175 #define KEYCODE_PAGEUP 0x0068 176 #define KEYCODE_LEFT 0x0069 177 #define KEYCODE_RIGHT 0x006A 178 #define KEYCODE_END 0x006B 179 #define KEYCODE_DOWN 0x006C 180 #define KEYCODE_PAGEDOWN 0x006D 181 #define KEYCODE_INSERT 0x006E 182 #define KEYCODE_DELETE 0x006F 183 #define KEYCODE_MACRO 0x0070 184 #define KEYCODE_MUTE 0x0071 185 #define KEYCODE_VOLUMEDOWN 0x0072 186 #define KEYCODE_VOLUMEUP 0x0073 187 #define KEYCODE_POWER 0x0074 188 #define KEYCODE_KPEQUAL 0x0075 189 #define KEYCODE_KPPLUSMINUS 0x0076 190 #define KEYCODE_KPCOMMA 0x0079 191 #define KEYCODE_LEFTMETA 0x007D 192 #define KEYCODE_RIGHTMETA 0x007E 193 #define KEYCODE_SLEEP 0x008E 194 #define KEYCODE_WAKEUP 0x008F 195 #define KEYCODE_KPLEFTPAREN 0x00B3 196 #define KEYCODE_KPRIGHTPAREN 0x00B4 197 #define KEYCODE_F13 0x00B7 198 #define KEYCODE_F14 0x00B8 199 #define KEYCODE_F15 0x00B9 200 #define KEYCODE_F16 0x00BA 201 #define KEYCODE_F17 0x00BB 202 #define KEYCODE_F18 0x00BC 203 #define KEYCODE_F19 0x00BD 204 #define KEYCODE_F20 0x00BE 205 #define KEYCODE_F21 0x00BF 206 #define KEYCODE_F22 0x00C0 207 #define KEYCODE_F23 0x00C1 208 #define KEYCODE_F24 0x00C2 209 #define KEYCODE_CLOSE 0x00CE 210 #define KEYCODE_PLAY 0x00CF 211 #define KEYCODE_PRINT 0x00D2 212 #define KEYCODE_SEARCH 0x00D9 213 #define KEYCODE_CANCEL 0x00DF 214 #define KEYCODE_BRIGHTNESS_DOWN 0x00E0 215 #define KEYCODE_BRIGHTNESS_UP 0x00E1 216 #define KEYCODE_BRIGHTNESS_CYCLE 0x00F3 217 #define KEYCODE_BRIGHTNESS_AUTO 0x00F4 218 #define KEYCODE_BTN0 0x0100 219 #define KEYCODE_BTN1 0x0101 220 #define KEYCODE_BTN2 0x0102 221 #define KEYCODE_BTN3 0x0103 222 #define KEYCODE_BTN4 0x0104 223 #define KEYCODE_BTN5 0x0105 224 #define KEYCODE_BTN6 0x0106 225 #define KEYCODE_BTN7 0x0107 226 #define KEYCODE_BTN8 0x0108 227 #define KEYCODE_BTN9 0x0109 228 #define KEYCODE_BTNLEFT 0x0110 229 #define KEYCODE_BTNRIGHT 0x0111 230 #define KEYCODE_BTNMIDDLE 0x0112 231 #define KEYCODE_BTNSIDE 0x0113 232 #define KEYCODE_BTNEXTRA 0x0114 233 #define KEYCODE_BTNTOUCH 0x014A 234 #define KEYCODE_EJECT 0x0200 235 #define KEYCODE_POWER_OFF 0x0201 236 #define KEYCODE_POWER_ON 0x0202 237 #define KEYCODE_INPUT_SELECT 0x0203 238 #define KEYCODE_INPUT_PC 0x0204 239 #define KEYCODE_INPUT_VIDEO1 0x0205 240 #define KEYCODE_INPUT_VIDEO2 0x0206 241 #define KEYCODE_INPUT_VIDEO3 0x0207 242 #define KEYCODE_INPUT_VIDEO4 0x0208 243 #define KEYCODE_INPUT_VIDEO5 0x0209 244 #define KEYCODE_INPUT_HDMI1 0x020A 245 #define KEYCODE_INPUT_HDMI2 0x020B 246 #define KEYCODE_INPUT_HDMI3 0x020C 247 #define KEYCODE_INPUT_HDMI4 0x020D 248 #define KEYCODE_INPUT_HDMI5 0x020E 249 #define KEYCODE_INPUT_AUX1 0x020F 250 #define KEYCODE_INPUT_AUX2 0x0210 251 #define KEYCODE_INPUT_AUX3 0x0211 252 #define KEYCODE_INPUT_AUX4 0x0212 253 #define KEYCODE_INPUT_AUX5 0x0213 254 #define KEYCODE_INPUT_CD 0x0214 255 #define KEYCODE_INPUT_DVD 0x0215 256 #define KEYCODE_INPUT_PHONO 0x0216 257 #define KEYCODE_INPUT_TAPE1 0x0217 258 #define KEYCODE_INPUT_TAPE2 0x0218 259 #define KEYCODE_INPUT_TUNER 0x0219 260 #define KEYCODE_INPUT_ANALOG 0x021A 261 #define KEYCODE_INPUT_DIGITAL 0x021B 262 #define KEYCODE_INPUT_INTERNET 0x021C 263 #define KEYCODE_INPUT_TEXT 0x021D 264 #define KEYCODE_INPUT_NEXT 0x021E 265 #define KEYCODE_INPUT_PREV 0x021F 266 #define KEYCODE_VIDEO_ASPECT 0x0220 267 #define KEYCODE_VIDEO_PIP 0x0221 268 #define KEYCODE_AUDIO_MONITOR 0x0222 269 #define KEYCODE_CLEAR 0x0223 270 #define KEYCODE_TIMER 0x0224 271 #define KEYCODE_CHANNEL_PREV 0x0225 272 #define KEYCODE_CHANNEL_GUIDE 0x0226 273 #define KEYCODE_RECORD 0x0227 274 #define KEYCODE_RECORD_SPEED 0x0228 275 #define KEYCODE_PLAY_SPEED 0x0229 276 #define KEYCODE_PLAY_MODE 0x022A 277 #define KEYCODE_REPLAY 0x022B 278 #define KEYCODE_DISPLAY 0x022C 279 #define KEYCODE_MENU 0x022D 280 #define KEYCODE_INFO 0x022E 281 #define KEYCODE_THUMBS_UP 0x022F 282 #define KEYCODE_THUMBS_DOWN 0x0230 283 #define KEYCODE_FAVOURITE 0x0231 284 #define KEYCODE_BUTTON_RED 0x0232 285 #define KEYCODE_BUTTON_GREEN 0x0233 286 #define KEYCODE_BUTTON_YELLOW 0x0234 287 #define KEYCODE_BUTTON_BLUE 0x0235 288 #define KEYCODE_SEARCH_LEFT 0x0236 289 #define KEYCODE_SEARCH_RIGHT 0x0237 290 #define KEYCODE_CHAPTER_NEXT 0x0238 291 #define KEYCODE_CHAPTER_PREV 0x0239 292 #define KEYCODE_NAV_SELECT 0x023A 293 #define KEYCODE_SUBTITLE_TOGGLE 0x023B 294 #define KEYCODE_SUBTITLE_ON 0x023C 295 #define KEYCODE_SUBTITLE_OFF 0x023D 296 #define KEYCODE_STOP 0x023E 297 #define KEYCODE_PAUSE 0x023F 298 #define KEYCODE_BROWSE 0x0240 299 #define KEYCODE_SHUFFLE 0x0241 300 #define KEYCODE_REPEAT 0x0242 301 #define KEYCODE_KEYPAD_10PLUS 0x0243 302 #define KEYCODE_BUTTON_USER 0x0244 346 case KEYCODE_LEFTCTRL:
348 case KEYCODE_RIGHTCTRL:
350 case KEYCODE_LEFTSHIFT:
352 case KEYCODE_RIGHTSHIFT:
354 case KEYCODE_LEFTALT:
356 case KEYCODE_RIGHTALT:
358 case KEYCODE_LEFTMETA:
360 case KEYCODE_RIGHTMETA:
362 case KEYCODE_CAPSLOCK:
364 case KEYCODE_NUMLOCK:
366 case KEYCODE_SCROLLLOCK:
425 case KEYCODE_LEFTBRACE:
427 case KEYCODE_RIGHTBRACE:
449 case KEYCODE_SEMICOLON:
451 case KEYCODE_APOSTROPHE:
455 case KEYCODE_BACKSLASH:
477 case KEYCODE_KPASTERISK:
487 case KEYCODE_KPMINUS:
507 case KEYCODE_KPENTER:
509 case KEYCODE_KPSLASH:
511 case KEYCODE_LINEFEED:
513 case KEYCODE_KPCOMMA:
515 case KEYCODE_KPLEFTPAREN:
517 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 on).
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.