include: update event codes to v5.8
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 12 Aug 2020 23:59:10 +0000 (09:59 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 13 Aug 2020 01:02:33 +0000 (11:02 +1000)
SW_MAX changed and the device_capability_nocaps_ignored test will fail on
older kernels. Change that test to use some other unhandled-by-libinput switch
code instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
include/linux/freebsd/input-event-codes.h
include/linux/linux/input-event-codes.h
test/test-device.c

index 7f14d4a66c28c1c13d1388c6dacfcff30711edab..0c2e27d28e0acdf825bab42cbffb452275f065ed 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
 /*
  * Input event codes
  *
 #define KEY_TITLE              0x171
 #define KEY_SUBTITLE           0x172
 #define KEY_ANGLE              0x173
-#define KEY_ZOOM               0x174
+#define KEY_FULL_SCREEN                0x174   /* AC View Toggle */
+#define KEY_ZOOM               KEY_FULL_SCREEN
 #define KEY_MODE               0x175
 #define KEY_KEYBOARD           0x176
-#define KEY_SCREEN             0x177
+#define KEY_ASPECT_RATIO       0x177   /* HUTRR37: Aspect */
+#define KEY_SCREEN             KEY_ASPECT_RATIO
 #define KEY_PC                 0x178   /* Media Select Computer */
 #define KEY_TV                 0x179   /* Media Select TV */
 #define KEY_TV2                        0x17a   /* Media Select Cable */
 #define KEY_SCREENSAVER                0x245   /* AL Screen Saver */
 #define KEY_VOICECOMMAND               0x246   /* Listening Voice Command */
 #define KEY_ASSISTANT          0x247   /* AL Context-aware desktop assistant */
+#define KEY_KBD_LAYOUT_NEXT    0x248   /* AC Next Keyboard Layout Select */
 
 #define KEY_BRIGHTNESS_MIN             0x250   /* Set Brightness to Minimum */
 #define KEY_BRIGHTNESS_MAX             0x251   /* Set Brightness to Maximum */
  */
 #define KEY_DATA                       0x277
 #define KEY_ONSCREEN_KEYBOARD          0x278
+/* Electronic privacy screen control */
+#define KEY_PRIVACY_SCREEN_TOGGLE      0x279
+
+/* Select an area of screen to be copied */
+#define KEY_SELECTIVE_SCREENSHOT       0x27a
+
+/*
+ * Some keyboards have keys which do not have a defined meaning, these keys
+ * are intended to be programmed / bound to macros by the user. For most
+ * keyboards with these macro-keys the key-sequence to inject, or action to
+ * take, is all handled by software on the host side. So from the kernel's
+ * point of view these are just normal keys.
+ *
+ * The KEY_MACRO# codes below are intended for such keys, which may be labeled
+ * e.g. G1-G18, or S1 - S30. The KEY_MACRO# codes MUST NOT be used for keys
+ * where the marking on the key does indicate a defined meaning / purpose.
+ *
+ * The KEY_MACRO# codes MUST also NOT be used as fallback for when no existing
+ * KEY_FOO define matches the marking / purpose. In this case a new KEY_FOO
+ * define MUST be added.
+ */
+#define KEY_MACRO1                     0x290
+#define KEY_MACRO2                     0x291
+#define KEY_MACRO3                     0x292
+#define KEY_MACRO4                     0x293
+#define KEY_MACRO5                     0x294
+#define KEY_MACRO6                     0x295
+#define KEY_MACRO7                     0x296
+#define KEY_MACRO8                     0x297
+#define KEY_MACRO9                     0x298
+#define KEY_MACRO10                    0x299
+#define KEY_MACRO11                    0x29a
+#define KEY_MACRO12                    0x29b
+#define KEY_MACRO13                    0x29c
+#define KEY_MACRO14                    0x29d
+#define KEY_MACRO15                    0x29e
+#define KEY_MACRO16                    0x29f
+#define KEY_MACRO17                    0x2a0
+#define KEY_MACRO18                    0x2a1
+#define KEY_MACRO19                    0x2a2
+#define KEY_MACRO20                    0x2a3
+#define KEY_MACRO21                    0x2a4
+#define KEY_MACRO22                    0x2a5
+#define KEY_MACRO23                    0x2a6
+#define KEY_MACRO24                    0x2a7
+#define KEY_MACRO25                    0x2a8
+#define KEY_MACRO26                    0x2a9
+#define KEY_MACRO27                    0x2aa
+#define KEY_MACRO28                    0x2ab
+#define KEY_MACRO29                    0x2ac
+#define KEY_MACRO30                    0x2ad
+
+/*
+ * Some keyboards with the macro-keys described above have some extra keys
+ * for controlling the host-side software responsible for the macro handling:
+ * -A macro recording start/stop key. Note that not all keyboards which emit
+ *  KEY_MACRO_RECORD_START will also emit KEY_MACRO_RECORD_STOP if
+ *  KEY_MACRO_RECORD_STOP is not advertised, then KEY_MACRO_RECORD_START
+ *  should be interpreted as a recording start/stop toggle;
+ * -Keys for switching between different macro (pre)sets, either a key for
+ *  cycling through the configured presets or keys to directly select a preset.
+ */
+#define KEY_MACRO_RECORD_START         0x2b0
+#define KEY_MACRO_RECORD_STOP          0x2b1
+#define KEY_MACRO_PRESET_CYCLE         0x2b2
+#define KEY_MACRO_PRESET1              0x2b3
+#define KEY_MACRO_PRESET2              0x2b4
+#define KEY_MACRO_PRESET3              0x2b5
+
+/*
+ * Some keyboards have a buildin LCD panel where the contents are controlled
+ * by the host. Often these have a number of keys directly below the LCD
+ * intended for controlling a menu shown on the LCD. These keys often don't
+ * have any labeling so we just name them KEY_KBD_LCD_MENU#
+ */
+#define KEY_KBD_LCD_MENU1              0x2b8
+#define KEY_KBD_LCD_MENU2              0x2b9
+#define KEY_KBD_LCD_MENU3              0x2ba
+#define KEY_KBD_LCD_MENU4              0x2bb
+#define KEY_KBD_LCD_MENU5              0x2bc
 
 #define BTN_TRIGGER_HAPPY              0x2c0
 #define BTN_TRIGGER_HAPPY1             0x2c0
 #define SW_LINEIN_INSERT       0x0d  /* set = inserted */
 #define SW_MUTE_DEVICE         0x0e  /* set = device disabled */
 #define SW_PEN_INSERTED                0x0f  /* set = pen inserted */
-#define SW_MAX                 0x0f
+#define SW_MACHINE_COVER       0x10  /* set = cover closed */
+#define SW_MAX                 0x10
 #define SW_CNT                 (SW_MAX+1)
 
 /*
index 7f14d4a66c28c1c13d1388c6dacfcff30711edab..0c2e27d28e0acdf825bab42cbffb452275f065ed 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
 /*
  * Input event codes
  *
 #define KEY_TITLE              0x171
 #define KEY_SUBTITLE           0x172
 #define KEY_ANGLE              0x173
-#define KEY_ZOOM               0x174
+#define KEY_FULL_SCREEN                0x174   /* AC View Toggle */
+#define KEY_ZOOM               KEY_FULL_SCREEN
 #define KEY_MODE               0x175
 #define KEY_KEYBOARD           0x176
-#define KEY_SCREEN             0x177
+#define KEY_ASPECT_RATIO       0x177   /* HUTRR37: Aspect */
+#define KEY_SCREEN             KEY_ASPECT_RATIO
 #define KEY_PC                 0x178   /* Media Select Computer */
 #define KEY_TV                 0x179   /* Media Select TV */
 #define KEY_TV2                        0x17a   /* Media Select Cable */
 #define KEY_SCREENSAVER                0x245   /* AL Screen Saver */
 #define KEY_VOICECOMMAND               0x246   /* Listening Voice Command */
 #define KEY_ASSISTANT          0x247   /* AL Context-aware desktop assistant */
+#define KEY_KBD_LAYOUT_NEXT    0x248   /* AC Next Keyboard Layout Select */
 
 #define KEY_BRIGHTNESS_MIN             0x250   /* Set Brightness to Minimum */
 #define KEY_BRIGHTNESS_MAX             0x251   /* Set Brightness to Maximum */
  */
 #define KEY_DATA                       0x277
 #define KEY_ONSCREEN_KEYBOARD          0x278
+/* Electronic privacy screen control */
+#define KEY_PRIVACY_SCREEN_TOGGLE      0x279
+
+/* Select an area of screen to be copied */
+#define KEY_SELECTIVE_SCREENSHOT       0x27a
+
+/*
+ * Some keyboards have keys which do not have a defined meaning, these keys
+ * are intended to be programmed / bound to macros by the user. For most
+ * keyboards with these macro-keys the key-sequence to inject, or action to
+ * take, is all handled by software on the host side. So from the kernel's
+ * point of view these are just normal keys.
+ *
+ * The KEY_MACRO# codes below are intended for such keys, which may be labeled
+ * e.g. G1-G18, or S1 - S30. The KEY_MACRO# codes MUST NOT be used for keys
+ * where the marking on the key does indicate a defined meaning / purpose.
+ *
+ * The KEY_MACRO# codes MUST also NOT be used as fallback for when no existing
+ * KEY_FOO define matches the marking / purpose. In this case a new KEY_FOO
+ * define MUST be added.
+ */
+#define KEY_MACRO1                     0x290
+#define KEY_MACRO2                     0x291
+#define KEY_MACRO3                     0x292
+#define KEY_MACRO4                     0x293
+#define KEY_MACRO5                     0x294
+#define KEY_MACRO6                     0x295
+#define KEY_MACRO7                     0x296
+#define KEY_MACRO8                     0x297
+#define KEY_MACRO9                     0x298
+#define KEY_MACRO10                    0x299
+#define KEY_MACRO11                    0x29a
+#define KEY_MACRO12                    0x29b
+#define KEY_MACRO13                    0x29c
+#define KEY_MACRO14                    0x29d
+#define KEY_MACRO15                    0x29e
+#define KEY_MACRO16                    0x29f
+#define KEY_MACRO17                    0x2a0
+#define KEY_MACRO18                    0x2a1
+#define KEY_MACRO19                    0x2a2
+#define KEY_MACRO20                    0x2a3
+#define KEY_MACRO21                    0x2a4
+#define KEY_MACRO22                    0x2a5
+#define KEY_MACRO23                    0x2a6
+#define KEY_MACRO24                    0x2a7
+#define KEY_MACRO25                    0x2a8
+#define KEY_MACRO26                    0x2a9
+#define KEY_MACRO27                    0x2aa
+#define KEY_MACRO28                    0x2ab
+#define KEY_MACRO29                    0x2ac
+#define KEY_MACRO30                    0x2ad
+
+/*
+ * Some keyboards with the macro-keys described above have some extra keys
+ * for controlling the host-side software responsible for the macro handling:
+ * -A macro recording start/stop key. Note that not all keyboards which emit
+ *  KEY_MACRO_RECORD_START will also emit KEY_MACRO_RECORD_STOP if
+ *  KEY_MACRO_RECORD_STOP is not advertised, then KEY_MACRO_RECORD_START
+ *  should be interpreted as a recording start/stop toggle;
+ * -Keys for switching between different macro (pre)sets, either a key for
+ *  cycling through the configured presets or keys to directly select a preset.
+ */
+#define KEY_MACRO_RECORD_START         0x2b0
+#define KEY_MACRO_RECORD_STOP          0x2b1
+#define KEY_MACRO_PRESET_CYCLE         0x2b2
+#define KEY_MACRO_PRESET1              0x2b3
+#define KEY_MACRO_PRESET2              0x2b4
+#define KEY_MACRO_PRESET3              0x2b5
+
+/*
+ * Some keyboards have a buildin LCD panel where the contents are controlled
+ * by the host. Often these have a number of keys directly below the LCD
+ * intended for controlling a menu shown on the LCD. These keys often don't
+ * have any labeling so we just name them KEY_KBD_LCD_MENU#
+ */
+#define KEY_KBD_LCD_MENU1              0x2b8
+#define KEY_KBD_LCD_MENU2              0x2b9
+#define KEY_KBD_LCD_MENU3              0x2ba
+#define KEY_KBD_LCD_MENU4              0x2bb
+#define KEY_KBD_LCD_MENU5              0x2bc
 
 #define BTN_TRIGGER_HAPPY              0x2c0
 #define BTN_TRIGGER_HAPPY1             0x2c0
 #define SW_LINEIN_INSERT       0x0d  /* set = inserted */
 #define SW_MUTE_DEVICE         0x0e  /* set = device disabled */
 #define SW_PEN_INSERTED                0x0f  /* set = pen inserted */
-#define SW_MAX                 0x0f
+#define SW_MACHINE_COVER       0x10  /* set = cover closed */
+#define SW_MAX                 0x10
 #define SW_CNT                 (SW_MAX+1)
 
 /*
index 44de8dc19f796747a23aa79e7923d774082bb66c..3a4a6b57604ccc8ddfed1354e0df4649fb259d59 100644 (file)
@@ -1462,10 +1462,11 @@ START_TEST(device_capability_nocaps_ignored)
        struct libinput *li;
        struct libinput_device *device;
 
-       /* SW_MAX isn't handled in libinput so the device is processed but
-        * ends up without seat capabilities and is ignored. */
+       /* SW_PEN_INSERTED isn't handled in libinput so the device is
+        * processed but ends up without seat capabilities and is ignored.
+        */
        uinput = litest_create_uinput_device("test device", NULL,
-                                            EV_SW, SW_MAX,
+                                            EV_SW, SW_PEN_INSERTED,
                                             -1);
        li = litest_create_context();
        device = libinput_path_add_device(li,