improved autorepeat behavior in menus
[libpicofe.git] / gp2x / menu.c
index 05d0903..db4c9fa 100644 (file)
@@ -46,7 +46,7 @@ static int inp_prevjoy = 0;
 static unsigned long wait_for_input(unsigned long interesting)\r
 {\r
        unsigned long ret;\r
-       static int repeats = 0, wait = 6;\r
+       static int repeats = 0, wait = 20;\r
        int release = 0, i;\r
 \r
        if      (repeats == 2) wait = 3;\r
@@ -65,8 +65,10 @@ static unsigned long wait_for_input(unsigned long interesting)
 \r
        if (release || ret != inp_prev) {\r
                repeats = 0;\r
-               wait = 6;\r
+               wait = 20;\r
        }\r
+       if (wait > 6 && (ret&(GP2X_UP|GP2X_LEFT|GP2X_DOWN|GP2X_RIGHT)))\r
+               wait = 6;\r
        inp_prev = ret;\r
        inp_prevjoy = 0;\r
 \r