Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (Revision 18387) +++ apps/lang/english.lang (Arbeitskopie) @@ -12037,3 +12037,17 @@ recording: "" + + id: LANG_BTN_LONG_PRESS_DURATION + desc: Long button press duration in ticks + user: + + *: "Long Button Press Duration" + + + *: "Long Button Press Duration" + + + *: "Long Button Press Duration" + + Index: apps/settings.h =================================================================== --- apps/settings.h (Revision 18387) +++ apps/settings.h (Arbeitskopie) @@ -451,6 +451,7 @@ bool play_selected; /* Plays selected file even in shuffle mode */ int ff_rewind_min_step; /* FF/Rewind minimum step size */ int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */ + int btn_long_press_duration; /* Long press duration in ticks (=1/100s) */ #ifndef HAVE_FLASH_STORAGE int disk_spindown; /* time until disk spindown, in seconds (0=off) */ Index: apps/menus/settings_menu.c =================================================================== --- apps/menus/settings_menu.c (Revision 18387) +++ apps/menus/settings_menu.c (Arbeitskopie) @@ -329,7 +329,10 @@ &keyclick, &keyclick_repeats); #endif +MENUITEM_SETTING(btn_long_press_duration, + &global_settings.btn_long_press_duration, NULL); + #if CONFIG_CODEC == MAS3507D void dac_line_in(bool enable); static int linein_callback(int action,const struct menu_item_ex *this_item) @@ -406,6 +409,7 @@ #if CONFIG_CODEC == SWCODEC &keyclick_menu, #endif + &btn_long_press_duration, #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING &touchpad_sensitivity, #endif Index: apps/settings_list.c =================================================================== --- apps/settings_list.c (Revision 18387) +++ apps/settings_list.c (Arbeitskopie) @@ -697,6 +697,9 @@ "seek acceleration", "very fast,fast,normal,slow,very slow", NULL, 5, ID2P(LANG_VERY_FAST), ID2P(LANG_FAST), ID2P(LANG_NORMAL), ID2P(LANG_SLOW) , ID2P(LANG_VERY_SLOW)), + INT_SETTING(0, btn_long_press_duration, LANG_BTN_LONG_PRESS_DURATION, 30, + "button long press duration", UNIT_INT, 20, 50, 1, NULL, NULL, + set_button_long_press_duration), #if (CONFIG_CODEC == SWCODEC) && !defined(HAVE_FLASH_STORAGE) STRINGCHOICE_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0,"antiskip", "5s,15s,30s,1min,2min,3min,5min,10min", NULL, 8, Index: firmware/export/button.h =================================================================== --- firmware/export/button.h (Revision 18387) +++ firmware/export/button.h (Arbeitskopie) @@ -60,6 +60,9 @@ int button_apply_acceleration(const unsigned int data); #endif +void set_button_long_press_duration(int ticks); + + #define BUTTON_NONE 0x00000000 /* Button modifiers */ Index: firmware/drivers/button.c =================================================================== --- firmware/drivers/button.c (Revision 18387) +++ firmware/drivers/button.c (Arbeitskopie) @@ -67,7 +67,7 @@ #endif /* how long until repeat kicks in, in ticks */ -#define REPEAT_START 30 +static int repeat_start = 30; /* the speed repeat starts at, in ticks */ #define REPEAT_INTERVAL_START 16 @@ -95,6 +95,15 @@ } #endif + +/* Sets the time interval, in ticks (=1/100s) after which a pressed + button will generate the repeat event. + */ +void set_button_long_press_duration(int ticks) +{ + repeat_start = ticks; +} + static void button_tick(void) { static int count = 0; @@ -216,7 +225,7 @@ } else { - if (count++ > REPEAT_START) + if (count++ > repeat_start) { post = true; repeat = true; Index: uisimulator/sdl/button.c =================================================================== --- uisimulator/sdl/button.c (Revision 18387) +++ uisimulator/sdl/button.c (Arbeitskopie) @@ -44,9 +44,10 @@ return touchscreen_mode; } #endif -/* how long until repeat kicks in */ -#define REPEAT_START 6 +/* how long until repeat kicks in, in ticks */ +static int repeat_start = 30; + /* the speed repeat starts at */ #define REPEAT_INTERVAL_START 4 @@ -998,7 +999,7 @@ } else { - if (count++ > REPEAT_START) + if (count++ > repeat_start) { post = true; repeat = true; @@ -1113,6 +1114,15 @@ #endif } + +/* Sets the time interval, in ticks (=1/100s) after which a pressed + button will generate the repeat event. + */ +void set_button_long_press_duration(int ticks) +{ + repeat_start = ticks; +} + #ifdef HAVE_TOUCHSCREEN extern bool debug_wps; void mouse_tick_task(void)