svn commit: r362206 - stable/12/sys/dev/evdev
Vladimir Kondratyev
wulf at FreeBSD.org
Mon Jun 15 22:33:00 UTC 2020
Author: wulf
Date: Mon Jun 15 22:32:59 2020
New Revision: 362206
URL: https://svnweb.freebsd.org/changeset/base/362206
Log:
MFC r360624:
[evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys.
"F lock" is a switch between two sets of scancodes for function keys F1-F12
found on some Logitech and Microsoft PS/2 keyboards [1]. When "F lock" is
pressed, then F1-F12 act as function keys and produce usual keyscans for
these keys. When "F lock" is depressed, F1-F12 produced the same keyscans
but prefixed with E0.
Some laptops use [2] E0-prefixed F1-F12 scancodes for non-standard keys.
[1] https://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html
[2] https://reviews.freebsd.org/D21565
MFC r360625:
[evdev] Sync event codes with Linux kernel 5.6
Modified:
stable/12/sys/dev/evdev/evdev_utils.c
stable/12/sys/dev/evdev/input-event-codes.h
stable/12/sys/dev/evdev/input.h
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/dev/evdev/evdev_utils.c
==============================================================================
--- stable/12/sys/dev/evdev/evdev_utils.c Mon Jun 15 20:12:10 2020 (r362205)
+++ stable/12/sys/dev/evdev/evdev_utils.c Mon Jun 15 22:32:59 2020 (r362206)
@@ -166,16 +166,16 @@ static uint16_t evdev_at_set1_scancodes[] = {
NONE, NONE, KEY_VOLUMEDOWN, NONE,
KEY_VOLUMEUP, NONE, KEY_HOMEPAGE, NONE,
NONE, KEY_KPSLASH, NONE, KEY_SYSRQ,
- KEY_RIGHTALT, NONE, NONE, NONE,
- NONE, NONE, NONE, NONE,
+ KEY_RIGHTALT, NONE, NONE, KEY_F13,
+ KEY_F14, KEY_F15, KEY_F16, KEY_F17,
/* 0x40 - 0x5f. 0xE0 prefixed */
- NONE, NONE, NONE, NONE,
- NONE, NONE, KEY_PAUSE, KEY_HOME,
+ KEY_F18, KEY_F19, KEY_F20, KEY_F21,
+ KEY_F22, NONE, KEY_PAUSE, KEY_HOME,
KEY_UP, KEY_PAGEUP, NONE, KEY_LEFT,
NONE, KEY_RIGHT, NONE, KEY_END,
KEY_DOWN, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE,
- NONE, NONE, NONE, NONE,
- NONE, NONE, NONE, KEY_LEFTMETA,
+ NONE, NONE, NONE, KEY_F23,
+ KEY_F24, NONE, NONE, KEY_LEFTMETA,
KEY_RIGHTMETA, KEY_MENU, KEY_POWER, KEY_SLEEP,
/* 0x60 - 0x7f. 0xE0 prefixed */
NONE, NONE, NONE, KEY_WAKEUP,
Modified: stable/12/sys/dev/evdev/input-event-codes.h
==============================================================================
--- stable/12/sys/dev/evdev/input-event-codes.h Mon Jun 15 20:12:10 2020 (r362205)
+++ stable/12/sys/dev/evdev/input-event-codes.h Mon Jun 15 22:32:59 2020 (r362206)
@@ -453,10 +453,12 @@
#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 */
@@ -618,6 +620,7 @@
#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 */
@@ -660,7 +663,87 @@
*/
#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 BTN_TRIGGER_HAPPY2 0x2c1
@@ -722,6 +805,16 @@
#define REL_DIAL 0x07
#define REL_WHEEL 0x08
#define REL_MISC 0x09
+/*
+ * 0x0a is reserved and should not be used in input drivers.
+ * It was used by HID as REL_MISC+1 and userspace needs to detect if
+ * the next REL_* event is correct or is just REL_MISC + n.
+ * We define here REL_RESERVED so userspace can rely on it and detect
+ * the situation described above.
+ */
+#define REL_RESERVED 0x0a
+#define REL_WHEEL_HI_RES 0x0b
+#define REL_HWHEEL_HI_RES 0x0c
#define REL_MAX 0x0f
#define REL_CNT (REL_MAX+1)
@@ -757,6 +850,15 @@
#define ABS_VOLUME 0x20
#define ABS_MISC 0x28
+
+/*
+ * 0x2e is reserved and should not be used in input drivers.
+ * It was used by HID as ABS_MISC+6 and userspace needs to detect if
+ * the next ABS_* event is correct or is just ABS_MISC + n.
+ * We define here ABS_RESERVED so userspace can rely on it and detect
+ * the situation described above.
+ */
+#define ABS_RESERVED 0x2e
#define ABS_MT_SLOT 0x2f /* MT slot being modified */
#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */
Modified: stable/12/sys/dev/evdev/input.h
==============================================================================
--- stable/12/sys/dev/evdev/input.h Mon Jun 15 20:12:10 2020 (r362205)
+++ stable/12/sys/dev/evdev/input.h Mon Jun 15 22:32:59 2020 (r362206)
@@ -148,10 +148,11 @@ struct input_keymap_entry {
/*
* MT_TOOL types
*/
-#define MT_TOOL_FINGER 0
-#define MT_TOOL_PEN 1
-#define MT_TOOL_PALM 2
-#define MT_TOOL_MAX 2
+#define MT_TOOL_FINGER 0x00
+#define MT_TOOL_PEN 0x01
+#define MT_TOOL_PALM 0x02
+#define MT_TOOL_DIAL 0x0a
+#define MT_TOOL_MAX 0x0f
/*
* Values describing the status of a force-feedback effect
More information about the svn-src-all
mailing list