Commit 8a50a17d authored by Peter Hutterer's avatar Peter Hutterer

Hook up scroll events

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent ec5614d8
......@@ -350,6 +350,23 @@ xf86libinput_handle_key(InputInfoPtr pInfo, struct libinput_event_keyboard_key *
xf86PostKeyboardEvent(dev, key, is_press);
}
static void
xf86libinput_handle_axis(InputInfoPtr pInfo, struct libinput_event_pointer_axis *event)
{
DeviceIntPtr dev = pInfo->dev;
int axis;
li_fixed_t value;
if (libinput_event_pointer_axis_get_axis(event) ==
LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL)
axis = 3;
else
axis = 4;
value = libinput_event_pointer_axis_get_value(event);
xf86PostMotionEvent(dev, Relative, axis, 1, li_fixed_to_int(value));
}
static void
xf86libinput_handle_event(InputInfoPtr pInfo,
struct libinput_event *event)
......@@ -370,6 +387,9 @@ xf86libinput_handle_event(InputInfoPtr pInfo,
case LIBINPUT_EVENT_KEYBOARD_KEY:
xf86libinput_handle_key(pInfo, (struct libinput_event_keyboard_key*)event);
break;
case LIBINPUT_EVENT_POINTER_AXIS:
xf86libinput_handle_axis(pInfo, (struct libinput_event_pointer_axis*)event);
break;
default:
break;
}
......@@ -436,6 +456,9 @@ static int xf86libinput_pre_init(InputDriverPtr drv,
if (!driver_data)
goto fail;
driver_data->scroll_vdist = 1;
driver_data->scroll_hdist = 1;
device = xf86SetStrOption(pInfo->options, "Device", NULL);
if (!device)
goto fail;
......
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