rendered paste bodyIndex: firmware/target/arm/ipod/3g/button-3g.c
===================================================================
--- firmware/target/arm/ipod/3g/button-3g.c (revision 12631)
+++ firmware/target/arm/ipod/3g/button-3g.c (working copy)
@@ -40,6 +40,8 @@
#include "system.h"
#include "powermgmt.h"
+#define MIN_SENSITIVITY 6
+
/* iPod 3G and mini 1G, mini 2G uses iPod 4G code */
void handle_scroll_wheel(int new_scroll, int was_hold, int reverse)
{
@@ -54,18 +56,30 @@
{0, -1, 1, 0}
};
+ /* Increases speed of scrolling if wheel rotated faster */
+ static long old_tick = -1;
+ long new_tick = current_tick;
+ static int sensitivity = MIN_SENSITIVITY;
+
+ if ( TIME_AFTER( old_tick, new_tick ) >= 1 ) { /* lowest sensitivity */
+ sensitivity = MIN_SENSITIVITY;
+ }
+ old_tick = new_tick;
+
if ( prev_scroll == -1 ) {
prev_scroll = new_scroll;
}
else if (direction != scroll_state[prev_scroll][new_scroll]) {
direction = scroll_state[prev_scroll][new_scroll];
count = 0;
+ sensitivity = MIN_SENSITIVITY;
}
else if (!was_hold) {
backlight_on();
reset_poweroff_timer();
- if (++count == 6) { /* reduce sensitivity */
+ if (++count >= sensitivity ) { /* dynamic sensitivity */
count = 0;
+ if ( --sensitivity == 0 ) sensitivity = 1;
switch (direction) {
case 1:
if (reverse) {