summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2024-10-09 14:03:41 +1000
committerMarge Bot <emma+marge@anholt.net>2024-10-09 23:25:17 +0000
commitcb80d7f82d35f8068e06d45860ed958a948e15bf (patch)
treedb68e43bef731cde694dec0f570b31db3af61f9c /src
parent7c5635cd6f38d7bded1e4674da4c803e590844a5 (diff)
Map some specific high keycodes into the FK20-23 range
These mappings have been part of xkeyboard-config for over a decade and the likely reason they were introduced is that the corresponding evdev keycode is > 255. Let's forcibly remap those in the driver here so the rest of the system can switch to the real keycodes instead of having to map them to the whatever X expects. See https://github.com/systemd/systemd/pull/34325/ Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/62>
Diffstat (limited to 'src')
-rw-r--r--src/xf86libinput.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index 248d0c8..d7c3015 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -1729,6 +1729,14 @@ xf86libinput_handle_key(InputInfoPtr pInfo, struct libinput_event_keyboard *even
if ((driver_data->capabilities & CAP_KEYBOARD) == 0)
return;
+ /* keycodes > 256 that have a historical mapping in xkeyboard-config */
+ switch (key) {
+ case KEY_TOUCHPAD_TOGGLE: key = KEY_F21; break;
+ case KEY_TOUCHPAD_ON: key = KEY_F22; break;
+ case KEY_TOUCHPAD_OFF: key = KEY_F23; break;
+ case KEY_MICMUTE: key = KEY_F20; break;
+ }
+
key += XORG_KEYCODE_OFFSET;
is_press = (libinput_event_keyboard_get_key_state(event) == LIBINPUT_KEY_STATE_PRESSED);