forked from len0rd/rockbox
FiiO M3K: filter touchpad input when it's disabled
I had hoped this would fix FS#13297, but no luck. Might as well do this change anyway, because it's the "right" thing to do. Change-Id: I55819c881d2141dd565e1c1f21460578c9114ff6
This commit is contained in:
parent
4c94c17913
commit
55c95a9cf5
1 changed files with 14 additions and 10 deletions
|
|
@ -301,16 +301,20 @@ static void ft_step_state(uint32_t t, int evt, int tx, int ty)
|
|||
int dy = fsm.cur_y - fsm.orig_y;
|
||||
int dp = (dx*dx) + (dy*dy);
|
||||
if(dp >= ftd.scroll_thresh_sqr) {
|
||||
if(dy < 0) {
|
||||
queue_post(&button_queue, BUTTON_SCROLL_BACK, 0);
|
||||
} else {
|
||||
queue_post(&button_queue, BUTTON_SCROLL_FWD, 0);
|
||||
}
|
||||
/* avoid generating events if we're supposed to be inactive...
|
||||
* should not be necessary but better to be safe. */
|
||||
if(ftd.active) {
|
||||
if(dy < 0) {
|
||||
queue_post(&button_queue, BUTTON_SCROLL_BACK, 0);
|
||||
} else {
|
||||
queue_post(&button_queue, BUTTON_SCROLL_FWD, 0);
|
||||
}
|
||||
|
||||
/* Poke the backlight */
|
||||
backlight_on();
|
||||
buttonlight_on();
|
||||
reset_poweroff_timer();
|
||||
/* Poke the backlight */
|
||||
backlight_on();
|
||||
buttonlight_on();
|
||||
reset_poweroff_timer();
|
||||
}
|
||||
|
||||
fsm.orig_x = fsm.cur_x;
|
||||
fsm.orig_y = fsm.cur_y;
|
||||
|
|
@ -475,7 +479,7 @@ int button_read_device(void)
|
|||
if((b & (1 << 28)) == 0) r |= BUTTON_VOL_DOWN;
|
||||
if((b & (1 << 31)) == 0) r |= BUTTON_POWER;
|
||||
|
||||
return r;
|
||||
return touchpad_filter(r);
|
||||
}
|
||||
|
||||
bool headphones_inserted(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue