diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-06-07 22:16:40 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-06-07 22:28:58 +0100 |
commit | 55c95a9cf53f78490926be9ae6643fb2e61f9572 (patch) | |
tree | 1e51c86724edb49bdcec52a5963c8bffb23d742a | |
parent | 4c94c1791378aeccc419354dd3fc5eb7776793cb (diff) | |
download | rockbox-55c95a9cf53f78490926be9ae6643fb2e61f9572.tar.gz rockbox-55c95a9cf53f78490926be9ae6643fb2e61f9572.zip |
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
-rw-r--r-- | firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c b/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c index d566ccb6c8..4a853cd88f 100644 --- a/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c +++ b/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c | |||
@@ -301,17 +301,21 @@ static void ft_step_state(uint32_t t, int evt, int tx, int ty) | |||
301 | int dy = fsm.cur_y - fsm.orig_y; | 301 | int dy = fsm.cur_y - fsm.orig_y; |
302 | int dp = (dx*dx) + (dy*dy); | 302 | int dp = (dx*dx) + (dy*dy); |
303 | if(dp >= ftd.scroll_thresh_sqr) { | 303 | if(dp >= ftd.scroll_thresh_sqr) { |
304 | if(dy < 0) { | 304 | /* avoid generating events if we're supposed to be inactive... |
305 | queue_post(&button_queue, BUTTON_SCROLL_BACK, 0); | 305 | * should not be necessary but better to be safe. */ |
306 | } else { | 306 | if(ftd.active) { |
307 | queue_post(&button_queue, BUTTON_SCROLL_FWD, 0); | 307 | if(dy < 0) { |
308 | queue_post(&button_queue, BUTTON_SCROLL_BACK, 0); | ||
309 | } else { | ||
310 | queue_post(&button_queue, BUTTON_SCROLL_FWD, 0); | ||
311 | } | ||
312 | |||
313 | /* Poke the backlight */ | ||
314 | backlight_on(); | ||
315 | buttonlight_on(); | ||
316 | reset_poweroff_timer(); | ||
308 | } | 317 | } |
309 | 318 | ||
310 | /* Poke the backlight */ | ||
311 | backlight_on(); | ||
312 | buttonlight_on(); | ||
313 | reset_poweroff_timer(); | ||
314 | |||
315 | fsm.orig_x = fsm.cur_x; | 319 | fsm.orig_x = fsm.cur_x; |
316 | fsm.orig_y = fsm.cur_y; | 320 | fsm.orig_y = fsm.cur_y; |
317 | } | 321 | } |
@@ -475,7 +479,7 @@ int button_read_device(void) | |||
475 | if((b & (1 << 28)) == 0) r |= BUTTON_VOL_DOWN; | 479 | if((b & (1 << 28)) == 0) r |= BUTTON_VOL_DOWN; |
476 | if((b & (1 << 31)) == 0) r |= BUTTON_POWER; | 480 | if((b & (1 << 31)) == 0) r |= BUTTON_POWER; |
477 | 481 | ||
478 | return r; | 482 | return touchpad_filter(r); |
479 | } | 483 | } |
480 | 484 | ||
481 | bool headphones_inserted(void) | 485 | bool headphones_inserted(void) |