mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
FS#10148 by Dustin Skoracki, removes a redundant check for != BUTTON_NONE in the scrollwheel drivers.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20744 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
19fde6c0c0
commit
aef5731d71
2 changed files with 41 additions and 48 deletions
|
|
@ -99,32 +99,29 @@ static void scrollwheel(short dbop_din)
|
|||
old_btn = btn;
|
||||
repeat = counter = 0;
|
||||
}
|
||||
if (btn != BUTTON_NONE)
|
||||
/* wheel_delta will cause lists to jump over items,
|
||||
* we want this for fast scrolling, but we must keep it accurate
|
||||
* for slow scrolling */
|
||||
int wheel_delta = 0;
|
||||
/* generate repeats if quick enough, scroll slightly faster too*/
|
||||
if (repeat > 1)
|
||||
{
|
||||
/* wheel_delta will cause lists to jump over items,
|
||||
* we want this for fast scrolling, but we must keep it accurate
|
||||
* for slow scrolling */
|
||||
int wheel_delta = 0;
|
||||
/* generate repeats if quick enough, scroll slightly faster too*/
|
||||
if (repeat > 1)
|
||||
{
|
||||
btn |= BUTTON_REPEAT;
|
||||
wheel_delta = repeat>>2;
|
||||
}
|
||||
btn |= BUTTON_REPEAT;
|
||||
wheel_delta = repeat>>2;
|
||||
}
|
||||
|
||||
repeat += 2;
|
||||
repeat += 2;
|
||||
|
||||
/* the wheel is more reliable if we don't send ever change,
|
||||
* every 4th is basically one "physical click" is 1 item in
|
||||
* the rockbox menus */
|
||||
if (++counter >= 4 && queue_empty(&button_queue))
|
||||
{
|
||||
buttonlight_on();
|
||||
backlight_on();
|
||||
queue_post(&button_queue, btn, ((wheel_delta+1)<<24));
|
||||
/* message posted - reset count */
|
||||
counter = 0;
|
||||
}
|
||||
/* the wheel is more reliable if we don't send ever change,
|
||||
* every 4th is basically one "physical click" is 1 item in
|
||||
* the rockbox menus */
|
||||
if (++counter >= 4 && queue_empty(&button_queue))
|
||||
{
|
||||
buttonlight_on();
|
||||
backlight_on();
|
||||
queue_post(&button_queue, btn, ((wheel_delta+1)<<24));
|
||||
/* message posted - reset count */
|
||||
counter = 0;
|
||||
}
|
||||
}
|
||||
if (repeat > 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue