erosq: Fix scrollwheel regression introduced in 125e97b0

Change-Id: Ie1a53d7140ffb09d8e3a19a41617fdc51344a619
This commit is contained in:
Solomon Peachy 2020-11-03 08:18:21 -05:00
parent 611c18704c
commit 8029c89808

View file

@ -109,17 +109,23 @@ int button_read_device(void)
/* map linux event code to rockbox button bitmap */ /* map linux event code to rockbox button bitmap */
if(press) 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 else
{ {
int bmap = button_map(keycode);
#if defined(BUTTON_SCROLL_BACK) #if defined(BUTTON_SCROLL_BACK)
/* Wheel gives us press+release back to back; ignore the release */ /* Wheel gives us press+release back to back; ignore the release */
int bmap = button_map(keycode) & ~(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD); bmap &= ~(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD);
button_bitmap &= ~bmap;
#else
button_bitmap &= ~button_map(keycode);
#endif #endif
button_bitmap &= ~bmap;
} }
} }
} }