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
+10
View File
@@ -20,6 +20,7 @@
#include "../backend/hidpp20/features/HiresScroll.h"
#include "DeviceFeature.h"
#include "../actions/gesture/Gesture.h"
namespace logid {
namespace features
@@ -40,12 +41,21 @@ namespace features
explicit Config(Device* dev);
uint8_t getMode() const;
uint8_t getMask() const;
const std::shared_ptr<actions::Gesture>& upAction() const;
const std::shared_ptr<actions::Gesture>& downAction() const;
protected:
uint8_t _mode;
uint8_t _mask;
std::shared_ptr<actions::Gesture> _up_action;
std::shared_ptr<actions::Gesture> _down_action;
};
private:
void _handleScroll(backend::hidpp20::HiresScroll::WheelStatus event);
std::shared_ptr<backend::hidpp20::HiresScroll> _hires_scroll;
std::chrono::time_point<std::chrono::system_clock> _last_scroll;
int16_t _last_direction = 0;
Config _config;
};
}}