Index: rockbox_svn/firmware/drivers/button.c =================================================================== --- rockbox_svn.orig/firmware/drivers/button.c +++ rockbox_svn/firmware/drivers/button.c @@ -71,6 +71,10 @@ bool phones_present = false; /* speed repeat finishes at, in ticks */ #define REPEAT_INTERVAL_FINISH 5 +/* filter limit setting */ +#define FILTER_LIMIT 4 +static int filter; + static int button_read(void); static void button_tick(void) @@ -353,6 +357,8 @@ void button_init(void) remote_filter_first_keypress = false; #endif #endif + /* filter init */ + filter = 0; } #ifdef HAVE_LCD_BITMAP /* only bitmap displays can be flipped */ @@ -446,11 +452,20 @@ static int button_read(void) #endif /* Filter the button status. It is only accepted if we get the same - status twice in a row. */ + status FILTER_LIMIT times in a row. */ if (btn != last_read) + { + /* filter init */ + filter = 0; retval = lastbtn; + } else - retval = btn; + { + if(++filter > FILTER_LIMIT) + retval = btn; + else + retval = lastbtn; + } last_read = btn; return retval;