mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-04-14 10:54:17 +00:00
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>
This commit is contained in:
committed by
Marge Bot
parent
7c5635cd6f
commit
cb80d7f82d
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user