diff options
-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) |