Commit 6a8db186 authored by Peter Hutterer's avatar Peter Hutterer

Add the xorg keycode offset to the key events

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 2b572390
......@@ -40,6 +40,8 @@
#define TOUCHPAD_MAX_BUTTONS 7 /* three buttons, 4 scroll buttons */
#define TOUCHPAD_NUM_AXES 4 /* x, y, hscroll, vscroll */
#define TOUCH_MAX_SLOTS 15
#define XORG_KEYCODE_OFFSET 8
/*
libinput does not provide axis information for absolute devices, instead
it scales into the screen dimensions provided. So we set up the axes with
......@@ -351,6 +353,8 @@ xf86libinput_handle_key(InputInfoPtr pInfo, struct libinput_event_keyboard *even
int is_press;
int key = libinput_event_keyboard_get_key(event);
key += XORG_KEYCODE_OFFSET;
is_press = (libinput_event_keyboard_get_key_state(event) == LIBINPUT_KEYBOARD_KEY_STATE_PRESSED);
xf86PostKeyboardEvent(dev, key, is_press);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment