diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/button.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 5addfee3de..0af51dc3b2 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -70,27 +70,21 @@ static bool enable_sw_poweroff = true; | |||
70 | /* how long until repeat kicks in, in centiseconds */ | 70 | /* how long until repeat kicks in, in centiseconds */ |
71 | #define REPEAT_START (30*HZ/100) | 71 | #define REPEAT_START (30*HZ/100) |
72 | 72 | ||
73 | #ifndef HAVE_TOUCHSCREEN | 73 | /* The next two make repeat "accelerate", which is nice for lists |
74 | /* the next two make repeat "accelerate", which is nice for lists | ||
75 | * which begin to scroll a bit faster when holding until the | 74 | * which begin to scroll a bit faster when holding until the |
76 | * real list accerelation kicks in (this smoothes acceleration) | 75 | * real list accerelation kicks in (this smooths acceleration). |
76 | * | ||
77 | * Note that touchscreen pointing events are not subject to this | ||
78 | * acceleration and always use REPEAT_INTERVAL_TOUCH. (Do repeat | ||
79 | * events even do anything sane for touchscreens??) | ||
77 | */ | 80 | */ |
78 | 81 | ||
79 | /* the speed repeat starts at, in centiseconds */ | 82 | /* the speed repeat starts at, in centiseconds */ |
80 | #define REPEAT_INTERVAL_START (16*HZ/100) | 83 | #define REPEAT_INTERVAL_START (16*HZ/100) |
81 | /* speed repeat finishes at, in centiseconds */ | 84 | /* speed repeat finishes at, in centiseconds */ |
82 | #define REPEAT_INTERVAL_FINISH (5*HZ/100) | 85 | #define REPEAT_INTERVAL_FINISH (5*HZ/100) |
83 | #else | 86 | /* repeat interval for touch events */ |
84 | /* | 87 | #define REPEAT_INTERVAL_TOUCH (5*HZ/100) |
85 | * on touchscreen it's different, scrolling is done by swiping over the | ||
86 | * screen (potentially very quickly) and is completely different from button | ||
87 | * targets | ||
88 | * So, on touchscreen we don't want to artifically slow down early repeats, | ||
89 | * it'd have the contrary effect of making rockbox appear lagging | ||
90 | */ | ||
91 | #define REPEAT_INTERVAL_START (5*HZ/100) | ||
92 | #define REPEAT_INTERVAL_FINISH (5*HZ/100) | ||
93 | #endif | ||
94 | 88 | ||
95 | #ifdef HAVE_BUTTON_DATA | 89 | #ifdef HAVE_BUTTON_DATA |
96 | static int button_read(int *data); | 90 | static int button_read(int *data); |
@@ -275,6 +269,11 @@ static void button_tick(void) | |||
275 | /* yes we have repeat */ | 269 | /* yes we have repeat */ |
276 | if (repeat_speed > REPEAT_INTERVAL_FINISH) | 270 | if (repeat_speed > REPEAT_INTERVAL_FINISH) |
277 | repeat_speed--; | 271 | repeat_speed--; |
272 | #ifdef HAVE_TOUCHSCREEN | ||
273 | if(btn & BUTTON_TOUCHSCREEN) | ||
274 | repeat_speed = REPEAT_INTERVAL_TOUCH; | ||
275 | #endif | ||
276 | |||
278 | count = repeat_speed; | 277 | count = repeat_speed; |
279 | 278 | ||
280 | repeat_count++; | 279 | repeat_count++; |