]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hwdb: add scancodes for AYANEO devices (#33378)
authorDerek J. Clark <derekjohn.clark@gmail.com>
Tue, 18 Jun 2024 00:19:30 +0000 (17:19 -0700)
committerGitHub <noreply@github.com>
Tue, 18 Jun 2024 00:19:30 +0000 (09:19 +0900)
AYANEO has multiple models that all use the same AT Translated Set
2 Keyboard device with 3-4 buttons available. Starting with the
AYANEO 2 there was a change to the IMU programming they were using
that caused the scancodes to no longer present the correct values
in Linux. This change adds a blanket scancode mapping to present
the correct keycodes as designed by the OEM.

In some cases a kernel bug will cause the AT Translated Set 2
Keyboard to present as an AT Raw Set 2 keyboard. I have also
adjusted the scancodes for this scenario as well so they are
in line with expected behavior. Currently only the Kun is still
experiencing this bug.

Example userspace tool refs:
https://github.com/ShadowBlip/InputPlumber/blob/main/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb
https://github.com/ShadowBlip/HandyGCCS/blob/main/usr/lib/udev/hwdb.d/59-handygccs-ayaneo.hwdb
https://github.com/hhd-dev/hhd/tree/master/usr/lib/udev/hwdb.d

hwdb.d/60-keyboard.hwdb

index f1ea0f58b18df090e174738ad08d6bb4fdb17228..d271f17005fd0d387bffa38418b916b20e997a44 100644 (file)
@@ -290,10 +290,22 @@ evdev:name:gpio-keys:phys:gpio-keys/input0:ev:100003:dmi:*:svnASUSTeKCOMPUTERINC
 # All four of these buttons generate a multi-scancode sequence
 # consisting of Left_Meta, Right_Ctrl and another scancode.
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAYANEO:pnKUN:pvr*
- KEYBOARD_KEY_18=f13                              # LC (next to the left shoulder button)
- KEYBOARD_KEY_20=f14                              # RC (next to the right shoulder button)
- KEYBOARD_KEY_30=f15                              # Start (upper-right corner of screen)
- KEYBOARD_KEY_28=f16                              # Ayaneo (lower-right corner of screen)
+ KEYBOARD_KEY_18=f15                              # LC (next to the left shoulder button)
+ KEYBOARD_KEY_20=f16                              # RC (next to the right shoulder button)
+ KEYBOARD_KEY_28=f17                              # Ayaneo (lower-right corner of screen)
+ KEYBOARD_KEY_30=f18                              # Touchpad Mode (top-right corner of screen)
+
+# Most AYANEO devices expose an AT Translated Set 2 Keyboard
+# for either three or four additional buttons not available
+# on the Xbox360 controller. These buttons all generate a
+# multi-scancode sequence. The specific preceding codes
+# depend on the model, but the final scancode is always the
+# same.
+evdev:name:AT Translated Set 2 keyboard:dmi:*:svnAYANEO:*
+ KEYBOARD_KEY_66=f15                            # LC (All models)
+ KEYBOARD_KEY_67=f16                            # RC (All models)
+ KEYBOARD_KEY_68=f17                            # Ayaneo (All models)
+ KEYBOARD_KEY_69=f18                            # Touchpad Mode (Kun only)
 
 ###########################################################
 # BenQ