LCOV - code coverage report
Current view: top level - zephyr/dt-bindings/input - input-event-codes.h Coverage Total Hit
Test: new.info Lines: 99.5 % 215 214
Test Date: 2025-09-05 20:47:19

            Line data    Source code
       1            0 : /*
       2              :  * Copyright 2023 Google LLC
       3              :  *
       4              :  * SPDX-License-Identifier: Apache-2.0
       5              :  *
       6              :  * Input event codes, for codes available in Linux, use the same values as in
       7              :  * https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/input-event-codes.h
       8              :  */
       9              : 
      10              : #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_INPUT_INPUT_EVENT_CODES_H_
      11              : #define ZEPHYR_INCLUDE_DT_BINDINGS_INPUT_INPUT_EVENT_CODES_H_
      12              : 
      13              : /**
      14              :  * @defgroup input_events Input Event Definitions
      15              :  * @ingroup input_interface
      16              :  * @{
      17              :  */
      18              : 
      19              : 
      20              : /**
      21              :  * @name Input event types.
      22              :  * @anchor INPUT_EV_CODES
      23              :  * @{
      24              :  */
      25            1 : #define INPUT_EV_KEY 0x01               /**< Key event */
      26            1 : #define INPUT_EV_REL 0x02               /**< Relative coordinate event */
      27            1 : #define INPUT_EV_ABS 0x03               /**< Absolute coordinate event */
      28            1 : #define INPUT_EV_MSC 0x04               /**< Miscellaneous event */
      29            1 : #define INPUT_EV_DEVICE 0xef            /**< Device specific input event */
      30            1 : #define INPUT_EV_VENDOR_START 0xf0      /**< Vendor specific event start */
      31            1 : #define INPUT_EV_VENDOR_STOP 0xff       /**< Vendor specific event stop */
      32              : /** @} */
      33              : 
      34              : /**
      35              :  * @name Input event KEY codes.
      36              :  * @anchor INPUT_KEY_CODES
      37              :  * @{
      38              :  */
      39            1 : #define INPUT_KEY_RESERVED 0            /**< Reserved, do not use */
      40              : 
      41            1 : #define INPUT_KEY_0 11                  /**< 0 Key */
      42            1 : #define INPUT_KEY_1 2                   /**< 1 Key */
      43            1 : #define INPUT_KEY_2 3                   /**< 2 Key */
      44            1 : #define INPUT_KEY_3 4                   /**< 3 Key */
      45            1 : #define INPUT_KEY_4 5                   /**< 4 Key */
      46            1 : #define INPUT_KEY_5 6                   /**< 5 Key */
      47            1 : #define INPUT_KEY_6 7                   /**< 6 Key */
      48            1 : #define INPUT_KEY_7 8                   /**< 7 Key */
      49            1 : #define INPUT_KEY_8 9                   /**< 8 Key */
      50            1 : #define INPUT_KEY_9 10                  /**< 9 Key */
      51            1 : #define INPUT_KEY_A 30                  /**< A Key */
      52            1 : #define INPUT_KEY_APOSTROPHE 40         /**< Apostrophe Key */
      53            1 : #define INPUT_KEY_B 48                  /**< B Key */
      54            1 : #define INPUT_KEY_BACK 158              /**< Back Key */
      55            1 : #define INPUT_KEY_BACKSLASH 43          /**< Backslash Key */
      56            1 : #define INPUT_KEY_BACKSPACE 14          /**< Backspace Key */
      57            1 : #define INPUT_KEY_BLUETOOTH 237         /**< Bluetooth Key */
      58            1 : #define INPUT_KEY_BRIGHTNESSDOWN 224    /**< Brightness Up Key */
      59            1 : #define INPUT_KEY_BRIGHTNESSUP 225      /**< Brightneess Down Key */
      60            1 : #define INPUT_KEY_C 46                  /**< C Key */
      61            1 : #define INPUT_KEY_CAPSLOCK 58           /**< Caps Lock Key */
      62            1 : #define INPUT_KEY_COFFEE 152            /**< Screen Saver Key */
      63            1 : #define INPUT_KEY_COMMA 51              /**< Comma Key */
      64            1 : #define INPUT_KEY_COMPOSE 127           /**< Compose Key */
      65            1 : #define INPUT_KEY_CONNECT 218           /**< Connect Key */
      66            1 : #define INPUT_KEY_D 32                  /**< D Key */
      67            1 : #define INPUT_KEY_DELETE 111            /**< Delete Key */
      68            1 : #define INPUT_KEY_DOT 52                /**< Dot Key */
      69            1 : #define INPUT_KEY_DOWN 108              /**< Down Key */
      70            1 : #define INPUT_KEY_E 18                  /**< E Key */
      71            1 : #define INPUT_KEY_END 107               /**< End Key */
      72            1 : #define INPUT_KEY_ENTER 28              /**< Enter Key */
      73            1 : #define INPUT_KEY_EQUAL 13              /**< Equal Key */
      74            1 : #define INPUT_KEY_ESC 1                 /**< Escape Key */
      75            1 : #define INPUT_KEY_F 33                  /**< F Key */
      76            1 : #define INPUT_KEY_F1 59                 /**< F1 Key */
      77            1 : #define INPUT_KEY_F10 68                /**< F10 Key */
      78            1 : #define INPUT_KEY_F11 87                /**< F11 Key */
      79            1 : #define INPUT_KEY_F12 88                /**< F12 Key */
      80            1 : #define INPUT_KEY_F13 183               /**< F13 Key */
      81            1 : #define INPUT_KEY_F14 184               /**< F14 Key */
      82            1 : #define INPUT_KEY_F15 185               /**< F15 Key */
      83            1 : #define INPUT_KEY_F16 186               /**< F16 Key */
      84            1 : #define INPUT_KEY_F17 187               /**< F17 Key */
      85            1 : #define INPUT_KEY_F18 188               /**< F18 Key */
      86            1 : #define INPUT_KEY_F19 189               /**< F19 Key */
      87            1 : #define INPUT_KEY_F2 60                 /**< F2 Key */
      88            1 : #define INPUT_KEY_F20 190               /**< F20 Key */
      89            1 : #define INPUT_KEY_F21 191               /**< F21 Key */
      90            1 : #define INPUT_KEY_F22 192               /**< F22 Key */
      91            1 : #define INPUT_KEY_F23 193               /**< F23 Key */
      92            1 : #define INPUT_KEY_F24 194               /**< F24 Key */
      93            1 : #define INPUT_KEY_F3 61                 /**< F3 Key */
      94            1 : #define INPUT_KEY_F4 62                 /**< F4 Key */
      95            1 : #define INPUT_KEY_F5 63                 /**< F5 Key */
      96            1 : #define INPUT_KEY_F6 64                 /**< F6 Key */
      97            1 : #define INPUT_KEY_F7 65                 /**< F7 Key */
      98            1 : #define INPUT_KEY_F8 66                 /**< F8 Key */
      99            1 : #define INPUT_KEY_F9 67                 /**< F9 Key */
     100            1 : #define INPUT_KEY_FASTFORWARD 208       /**< Fast Forward Key */
     101            1 : #define INPUT_KEY_FORWARD 159           /**< Forward Key */
     102            1 : #define INPUT_KEY_G 34                  /**< G Key */
     103            1 : #define INPUT_KEY_GRAVE 41              /**< Grave (backtick) Key */
     104            1 : #define INPUT_KEY_H 35                  /**< H Key */
     105            1 : #define INPUT_KEY_HOME 102              /**< Home Key */
     106            1 : #define INPUT_KEY_I 23                  /**< I Key */
     107            1 : #define INPUT_KEY_INSERT 110            /**< Insert Key */
     108            1 : #define INPUT_KEY_J 36                  /**< J Key */
     109            1 : #define INPUT_KEY_K 37                  /**< K Key */
     110            1 : #define INPUT_KEY_KP0 82                /**< Keypad 0 Key */
     111            1 : #define INPUT_KEY_KP1 79                /**< Keypad 1 Key */
     112            1 : #define INPUT_KEY_KP2 80                /**< Keypad 2 Key */
     113            1 : #define INPUT_KEY_KP3 81                /**< Keypad 3 Key */
     114            1 : #define INPUT_KEY_KP4 75                /**< Keypad 4 Key */
     115            1 : #define INPUT_KEY_KP5 76                /**< Keypad 5 Key */
     116            1 : #define INPUT_KEY_KP6 77                /**< Keypad 6 Key */
     117            1 : #define INPUT_KEY_KP7 71                /**< Keypad 7 Key */
     118            1 : #define INPUT_KEY_KP8 72                /**< Keypad 8 Key */
     119            1 : #define INPUT_KEY_KP9 73                /**< Keypad 9 Key */
     120            1 : #define INPUT_KEY_KPASTERISK 55         /**< Keypad Asterisk Key */
     121            1 : #define INPUT_KEY_KPCOMMA 121           /**< Keypad Comma Key */
     122            1 : #define INPUT_KEY_KPDOT 83              /**< Keypad Dot Key */
     123            1 : #define INPUT_KEY_KPENTER 96            /**< Keypad Enter Key */
     124            1 : #define INPUT_KEY_KPEQUAL 117           /**< Keypad Equal Key */
     125            1 : #define INPUT_KEY_KPMINUS 74            /**< Keypad Minus Key */
     126            1 : #define INPUT_KEY_KPPLUS 78             /**< Keypad Plus Key */
     127            1 : #define INPUT_KEY_KPPLUSMINUS 118       /**< Keypad Plus Key */
     128            1 : #define INPUT_KEY_KPSLASH 98            /**< Keypad Slash Key */
     129            1 : #define INPUT_KEY_L 38                  /**< L Key */
     130            1 : #define INPUT_KEY_LEFT 105              /**< Left Key */
     131            1 : #define INPUT_KEY_LEFTALT 56            /**< Left Alt Key */
     132            1 : #define INPUT_KEY_LEFTBRACE 26          /**< Left Brace Key */
     133            1 : #define INPUT_KEY_LEFTCTRL 29           /**< Left Ctrl Key */
     134            1 : #define INPUT_KEY_LEFTMETA 125          /**< Left Meta Key */
     135            1 : #define INPUT_KEY_LEFTSHIFT 42          /**< Left Shift Key */
     136            1 : #define INPUT_KEY_M 50                  /**< M Key */
     137            1 : #define INPUT_KEY_MENU 139              /**< Menu Key */
     138            1 : #define INPUT_KEY_MINUS 12              /**< Minus Key */
     139            1 : #define INPUT_KEY_MUTE 113              /**< Mute Key */
     140            1 : #define INPUT_KEY_N 49                  /**< N Key */
     141            1 : #define INPUT_KEY_NUMLOCK 69            /**< Num Lock Key */
     142            1 : #define INPUT_KEY_O 24                  /**< O Key */
     143            1 : #define INPUT_KEY_P 25                  /**< P Key */
     144            1 : #define INPUT_KEY_PAGEDOWN 109          /**< Page Down Key */
     145            1 : #define INPUT_KEY_PAGEUP 104            /**< Page UpKey */
     146            1 : #define INPUT_KEY_PAUSE 119             /**< Pause Key */
     147            1 : #define INPUT_KEY_PLAY 207              /**< Play Key */
     148            1 : #define INPUT_KEY_POWER 116             /**< Power Key */
     149            1 : #define INPUT_KEY_PRINT 210             /**< Print Key */
     150            1 : #define INPUT_KEY_Q 16                  /**< Q Key */
     151            1 : #define INPUT_KEY_R 19                  /**< R Key */
     152            1 : #define INPUT_KEY_RIGHT 106             /**< Right Key */
     153            1 : #define INPUT_KEY_RIGHTALT 100          /**< Right Alt Key */
     154            1 : #define INPUT_KEY_RIGHTBRACE 27         /**< Right Brace Key */
     155            1 : #define INPUT_KEY_RIGHTCTRL 97          /**< Right Ctrl Key */
     156            1 : #define INPUT_KEY_RIGHTMETA 126         /**< Right Meta Key */
     157            1 : #define INPUT_KEY_RIGHTSHIFT 54         /**< Right Shift Key */
     158            1 : #define INPUT_KEY_S 31                  /**< S Key */
     159            1 : #define INPUT_KEY_SCALE 120             /**< Scale Key */
     160            1 : #define INPUT_KEY_SCROLLLOCK 70         /**< Scroll Lock Key */
     161            1 : #define INPUT_KEY_SEMICOLON 39          /**< Semicolon Key */
     162            1 : #define INPUT_KEY_SLASH 53              /**< Slash Key */
     163            1 : #define INPUT_KEY_SLEEP 142             /**< System Sleep Key */
     164            1 : #define INPUT_KEY_SPACE 57              /**< Space Key */
     165            1 : #define INPUT_KEY_SYSRQ 99              /**< SysReq Key */
     166            1 : #define INPUT_KEY_T 20                  /**< T Key */
     167            1 : #define INPUT_KEY_TAB 15                /**< Tab Key*/
     168            1 : #define INPUT_KEY_U 22                  /**< U Key */
     169            1 : #define INPUT_KEY_UP 103                /**< Up Key */
     170            1 : #define INPUT_KEY_UWB 239               /**< Ultra-Wideband Key */
     171            1 : #define INPUT_KEY_V 47                  /**< V Key */
     172            1 : #define INPUT_KEY_VOLUMEDOWN 114        /**< Volume Down Key */
     173            1 : #define INPUT_KEY_VOLUMEUP 115          /**< Volume Up Key */
     174            1 : #define INPUT_KEY_W 17                  /**< W Key */
     175            1 : #define INPUT_KEY_WAKEUP 143            /**< System Wake Up Key */
     176            1 : #define INPUT_KEY_WLAN 238              /**< Wireless LAN Key */
     177            1 : #define INPUT_KEY_X 45                  /**< X Key */
     178            1 : #define INPUT_KEY_Y 21                  /**< Y Key */
     179            1 : #define INPUT_KEY_Z 44                  /**< Z Key */
     180              : /** @} */
     181              : 
     182              : 
     183              : /**
     184              :  * @name Input event BTN codes.
     185              :  * @anchor INPUT_BTN_CODES
     186              :  * @{
     187              :  */
     188            1 : #define INPUT_BTN_0 0x100               /**< 0 button */
     189            1 : #define INPUT_BTN_1 0x101               /**< 1 button */
     190            1 : #define INPUT_BTN_2 0x102               /**< 2 button */
     191            1 : #define INPUT_BTN_3 0x103               /**< 3 button */
     192            1 : #define INPUT_BTN_4 0x104               /**< 4 button */
     193            1 : #define INPUT_BTN_5 0x105               /**< 5 button */
     194            1 : #define INPUT_BTN_6 0x106               /**< 6 button */
     195            1 : #define INPUT_BTN_7 0x107               /**< 7 button */
     196            1 : #define INPUT_BTN_8 0x108               /**< 8 button */
     197            1 : #define INPUT_BTN_9 0x109               /**< 9 button */
     198            1 : #define INPUT_BTN_A INPUT_BTN_SOUTH     /**< A button */
     199            1 : #define INPUT_BTN_B INPUT_BTN_EAST      /**< B button */
     200            1 : #define INPUT_BTN_BACK 0x116            /**< Back button */
     201            1 : #define INPUT_BTN_C 0x132               /**< C button */
     202            1 : #define INPUT_BTN_DPAD_DOWN 0x221       /**< Directional pad Down */
     203            1 : #define INPUT_BTN_DPAD_LEFT 0x222       /**< Directional pad Left */
     204            1 : #define INPUT_BTN_DPAD_RIGHT 0x223      /**< Directional pad Right */
     205            1 : #define INPUT_BTN_DPAD_UP 0x220         /**< Directional pad Up */
     206            1 : #define INPUT_BTN_EAST 0x131            /**< East button */
     207            1 : #define INPUT_BTN_EXTRA 0x114           /**< Extra button */
     208            1 : #define INPUT_BTN_FORWARD 0x115         /**< Forward button */
     209            1 : #define INPUT_BTN_GEAR_DOWN 0x150       /**< Gear Down button */
     210            1 : #define INPUT_BTN_GEAR_UP 0x151         /**< Gear Up button */
     211            1 : #define INPUT_BTN_LEFT 0x110            /**< Left button */
     212            1 : #define INPUT_BTN_MIDDLE 0x112          /**< Middle button */
     213            1 : #define INPUT_BTN_MODE 0x13c            /**< Mode button */
     214            1 : #define INPUT_BTN_NORTH 0x133           /**< North button */
     215            1 : #define INPUT_BTN_RIGHT 0x111           /**< Right button */
     216            1 : #define INPUT_BTN_SELECT 0x13a          /**< Select button */
     217            1 : #define INPUT_BTN_SIDE 0x113            /**< Side button */
     218            1 : #define INPUT_BTN_SOUTH 0x130           /**< South button */
     219            1 : #define INPUT_BTN_START 0x13b           /**< Start button */
     220            1 : #define INPUT_BTN_TASK 0x117            /**< Task button */
     221            1 : #define INPUT_BTN_THUMBL 0x13d          /**< Left thumbstick button */
     222            1 : #define INPUT_BTN_THUMBR 0x13e          /**< Right thumbstick button */
     223            1 : #define INPUT_BTN_TL 0x136              /**< Left trigger (L1) */
     224            1 : #define INPUT_BTN_TL2 0x138             /**< Left trigger 2 (L2) */
     225            1 : #define INPUT_BTN_TOUCH 0x14a           /**< Touchscreen touch */
     226            1 : #define INPUT_BTN_TR 0x137              /**< Right trigger (R1) */
     227            1 : #define INPUT_BTN_TR2 0x139             /**< Right trigger 2 (R2) */
     228            1 : #define INPUT_BTN_WEST 0x134            /**< West button */
     229            1 : #define INPUT_BTN_X INPUT_BTN_NORTH     /**< X button */
     230            1 : #define INPUT_BTN_Y INPUT_BTN_WEST      /**< Y button */
     231            1 : #define INPUT_BTN_Z 0x135               /**< Z button */
     232              : /** @} */
     233              : 
     234              : /**
     235              :  * @name Input event ABS codes.
     236              :  * @anchor INPUT_ABS_CODES
     237              :  * @{
     238              :  */
     239            1 : #define INPUT_ABS_BRAKE 0x0a            /**< Absolute brake position */
     240            1 : #define INPUT_ABS_GAS 0x09              /**< Absolute gas position */
     241            1 : #define INPUT_ABS_MT_SLOT 0x2f          /**< Absolute multitouch slot identifier */
     242            1 : #define INPUT_ABS_RUDDER 0x07           /**< Absolute rudder position */
     243            1 : #define INPUT_ABS_RX 0x03               /**< Absolute rotation around X axis */
     244            1 : #define INPUT_ABS_RY 0x04               /**< Absolute rotation around Y axis */
     245            1 : #define INPUT_ABS_RZ 0x05               /**< Absolute rotation around Z axis */
     246            1 : #define INPUT_ABS_THROTTLE 0x06         /**< Absolute throttle position */
     247            1 : #define INPUT_ABS_WHEEL 0x08            /**< Absolute wheel position */
     248            1 : #define INPUT_ABS_X 0x00                /**< Absolute X coordinate */
     249            1 : #define INPUT_ABS_Y 0x01                /**< Absolute Y coordinate */
     250            1 : #define INPUT_ABS_Z 0x02                /**< Absolute Z coordinate */
     251              : /** @} */
     252              : 
     253              : /**
     254              :  * @name Input event REL codes.
     255              :  * @anchor INPUT_REL_CODES
     256              :  * @{
     257              :  */
     258            1 : #define INPUT_REL_DIAL 0x07             /**< Relative dial coordinate */
     259            1 : #define INPUT_REL_HWHEEL 0x06           /**< Relative horizontal wheel coordinate */
     260            1 : #define INPUT_REL_MISC 0x09             /**< Relative misc coordinate */
     261            1 : #define INPUT_REL_RX 0x03               /**< Relative rotation around X axis */
     262            1 : #define INPUT_REL_RY 0x04               /**< Relative rotation around Y axis */
     263            1 : #define INPUT_REL_RZ 0x05               /**< Relative rotation around Z axis */
     264            1 : #define INPUT_REL_WHEEL 0x08            /**< Relative wheel coordinate */
     265            1 : #define INPUT_REL_X 0x00                /**< Relative X coordinate */
     266            1 : #define INPUT_REL_Y 0x01                /**< Relative Y coordinate */
     267            1 : #define INPUT_REL_Z 0x02                /**< Relative Z coordinate */
     268              : /** @} */
     269              : 
     270              : /**
     271              :  * @name Input event MSC codes.
     272              :  * @anchor INPUT_MSC_CODES
     273              :  * @{
     274              :  */
     275            1 : #define INPUT_MSC_SCAN 0x04             /**< Scan code */
     276              : /** @} */
     277              : 
     278              : /** @} */
     279              : 
     280              : #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_INPUT_INPUT_EVENT_CODES_H_ */
        

Generated by: LCOV version 2.0-1