diff options
Diffstat (limited to 'src/ui/encoder_input.cpp')
| -rw-r--r-- | src/ui/encoder_input.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/encoder_input.cpp b/src/ui/encoder_input.cpp index b27c2862..39aacc0c 100644 --- a/src/ui/encoder_input.cpp +++ b/src/ui/encoder_input.cpp @@ -264,6 +264,26 @@ auto EncoderInput::Read(lv_indev_data_t* data) -> void { break; } + // Only trigger the directional long-press gestures if they trigger at the + // same time as a trigger on the overall touchwheel. This means the + // gestures only trigger if it's your only interaction with the wheel this + // press; scrolling and then resting on a direction should not trigger + // them. + trigger = TriggerKey(Keys::kTouchWheel, KeyStyle::kLongPress, now_ms); + if (trigger == Trigger::kLongPress) { + trigger = + TriggerKey(Keys::kDirectionalLeft, KeyStyle::kLongPress, now_ms); + switch (trigger) { + case Trigger::kNone: + break; + case Trigger::kClick: + break; + case Trigger::kLongPress: + events::Ui().Dispatch(internal::BackPressed{}); + break; + } + } + break; } } |
