summaryrefslogtreecommitdiff
path: root/firmware/target/hosted
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-11-03 08:18:21 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-11-03 13:23:39 +0000
commit8029c898084787ca1e9e2d02afeff19de117aaed (patch)
tree39ec8e76c1a3bbcec024961ad0a2e2e5f412a2f3 /firmware/target/hosted
parent611c18704cf8a8866235e4b7fe93f17e8a2614c4 (diff)
erosq: Fix scrollwheel regression introduced in 125e97b0
Change-Id: Ie1a53d7140ffb09d8e3a19a41617fdc51344a619
Diffstat (limited to 'firmware/target/hosted')
-rw-r--r--firmware/target/hosted/button-devinput.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/firmware/target/hosted/button-devinput.c b/firmware/target/hosted/button-devinput.c
index 8c469b8308..448be2c5c4 100644
--- a/firmware/target/hosted/button-devinput.c
+++ b/firmware/target/hosted/button-devinput.c
@@ -109,17 +109,23 @@ int button_read_device(void)
/* map linux event code to rockbox button bitmap */
if(press)
{
- button_bitmap |= button_map(keycode);
+ int bmap = button_map(keycode);
+#if defined(BUTTON_SCROLL_BACK)
+ /* Keep track of when the last wheel tick happened */
+ if (bmap & (BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD))
+ last_tick = current_tick;
+#endif
+ button_bitmap |= bmap;
}
else
{
+ int bmap = button_map(keycode);
#if defined(BUTTON_SCROLL_BACK)
/* Wheel gives us press+release back to back; ignore the release */
- int bmap = button_map(keycode) & ~(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD);
- button_bitmap &= ~bmap;
-#else
- button_bitmap &= ~button_map(keycode);
+ bmap &= ~(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD);
#endif
+ button_bitmap &= ~bmap;
+
}
}
}