Support HiresScroll gesture remapping

This commit allows HiresScroll (when target is true) to map the up and
down events to gestures that support it (i.e.AxisGesture/
IntervalGesture). This check is done by checking if wheelCompatibility()
is true.

This also allows hires scroll events to send low-res scroll events as
well.

TODO: Fix bug w/ Chromium (and some other programs?) where mapping
scroll wheel to REL_WHEEL_HI_RES will cause the program to skip events
occassionally. I have literally been stuck on this bug for a week and I
still don't know what causes it. evtest shows proper scroll events,
Firefox works fine, and libinput test-gui reports proper scrolling.
This commit is contained in:
pixl
2020-08-21 16:05:20 -04:00
parent 6ea65601f3
commit c1423e345e
14 changed files with 251 additions and 17 deletions

View File

@@ -89,6 +89,17 @@ uint InputDevice::toAxisCode(const std::string& name)
return _toEventCode(EV_REL, name);
}
/* Returns -1 if axis_code is not hi-res */
int InputDevice::getLowResAxis(const uint axis_code)
{
if(axis_code == REL_WHEEL_HI_RES)
return REL_WHEEL;
if(axis_code == REL_HWHEEL_HI_RES)
return REL_HWHEEL;
return -1;
}
uint InputDevice::_toEventCode(uint type, const std::string& name)
{
int code = libevdev_event_code_from_name(type, name.c_str());