summaryrefslogtreecommitdiff
path: root/firmware
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
parent611c18704cf8a8866235e4b7fe93f17e8a2614c4 (diff)
downloadrockbox-8029c898084787ca1e9e2d02afeff19de117aaed.tar.gz
rockbox-8029c898084787ca1e9e2d02afeff19de117aaed.zip
erosq: Fix scrollwheel regression introduced in 125e97b0
Change-Id: Ie1a53d7140ffb09d8e3a19a41617fdc51344a619
Diffstat (limited to 'firmware')
-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)
109 /* map linux event code to rockbox button bitmap */ 109 /* map linux event code to rockbox button bitmap */
110 if(press) 110 if(press)
111 { 111 {
112 button_bitmap |= button_map(keycode); 112 int bmap = button_map(keycode);
113#if defined(BUTTON_SCROLL_BACK)
114 /* Keep track of when the last wheel tick happened */
115 if (bmap & (BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD))
116 last_tick = current_tick;
117#endif
118 button_bitmap |= bmap;
113 } 119 }
114 else 120 else
115 { 121 {
122 int bmap = button_map(keycode);
116#if defined(BUTTON_SCROLL_BACK) 123#if defined(BUTTON_SCROLL_BACK)
117 /* Wheel gives us press+release back to back; ignore the release */ 124 /* Wheel gives us press+release back to back; ignore the release */
118 int bmap = button_map(keycode) & ~(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD); 125 bmap &= ~(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD);
119 button_bitmap &= ~bmap;
120#else
121 button_bitmap &= ~button_map(keycode);
122#endif 126#endif
127 button_bitmap &= ~bmap;
128
123 } 129 }
124 } 130 }
125 } 131 }