diff options
-rw-r--r-- | apps/menu.c | 6 | ||||
-rw-r--r-- | apps/tree.c | 31 | ||||
-rw-r--r-- | apps/tree.h | 8 | ||||
-rw-r--r-- | apps/wps.c | 9 | ||||
-rw-r--r-- | apps/wps.h | 2 |
5 files changed, 48 insertions, 8 deletions
diff --git a/apps/menu.c b/apps/menu.c index 126d29f40a..6966bc990e 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -317,10 +317,11 @@ int menu_show(int m) switch( key ) { case MENU_PREV: + case MENU_PREV | BUTTON_REPEAT: #ifdef MENU_RC_PREV case MENU_RC_PREV: + case MENU_RC_PREV | BUTTON_REPEAT: #endif - case MENU_PREV | BUTTON_REPEAT: if (menus[m].cursor) { /* keep the cursor at 1/3 of the screen */ if (menus[m].top && menus[m].cursor - menus[m].top < @@ -339,10 +340,11 @@ int menu_show(int m) break; case MENU_NEXT: + case MENU_NEXT | BUTTON_REPEAT: #ifdef MENU_RC_NEXT case MENU_RC_NEXT: + case MENU_RC_NEXT | BUTTON_REPEAT: #endif - case MENU_NEXT | BUTTON_REPEAT: if (menus[m].cursor < menus[m].itemcount-1) { /* keep the cursor at 2/3 of the screen */ if (menus[m].itemcount - menus[m].top > menu_lines && diff --git a/apps/tree.c b/apps/tree.c index da0e54c815..cba8b56a6d 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -468,9 +468,14 @@ static bool ask_resume(bool ask_once) #else case TREE_RUN: #endif + +#ifdef TREE_RC_RUN_PRE + case TREE_RC_RUN_PRE: /* catch the press, not the release */ +#else #ifdef TREE_RC_RUN case TREE_RC_RUN: #endif +#endif ignore_power = false; /* Don't ignore the power button for subsequent calls */ return true; @@ -722,6 +727,9 @@ static bool dirbrowse(void) button = button_get(true); switch (button) { case TREE_RUN: +#ifdef TREE_RC_RUN + case TREE_RC_RUN: +#endif rolo_load("/" BOOTFILE); stop = true; break; @@ -747,10 +755,17 @@ static bool dirbrowse(void) #ifdef TREE_RC_ENTER case TREE_RC_ENTER: #endif +#ifdef TREE_RC_RUN + case TREE_RC_RUN: +#endif case TREE_RUN: #ifdef TREE_RUN_PRE - if ((button == TREE_RUN) && - (lastbutton != TREE_RUN_PRE)) + if (((button == TREE_RUN) +#ifdef TREE_RC_RUN_PRE + || (button == TREE_RC_RUN)) + && ((lastbutton != TREE_RC_RUN_PRE) +#endif + && (lastbutton != TREE_RUN_PRE))) break; #endif if ( !numentries ) @@ -1014,8 +1029,15 @@ static bool dirbrowse(void) break; case TREE_WPS: +#ifdef TREE_RC_WPS + case TREE_RC_WPS: +#endif #ifdef TREE_WPS_PRE - if (lastbutton != TREE_WPS_PRE) + if ((lastbutton != TREE_WPS_PRE) +#ifdef TREE_RC_WPS + && (lastbutton != TREE_RC_WPS_PRE) +#endif + ) break; #endif /* don't enter wps from plugin browser etc */ @@ -1059,6 +1081,9 @@ static bool dirbrowse(void) #endif case TREE_CONTEXT: +#ifdef TREE_RC_CONTEXT + case TREE_RC_CONTEXT: +#endif #ifdef TREE_CONTEXT2 case TREE_CONTEXT2: #endif diff --git a/apps/tree.h b/apps/tree.h index 5db786de49..dc7de24506 100644 --- a/apps/tree.h +++ b/apps/tree.h @@ -43,9 +43,13 @@ #define TREE_RC_NEXT BUTTON_RC_FF #define TREE_RC_PREV BUTTON_RC_REW #define TREE_RC_EXIT BUTTON_RC_STOP -#define TREE_RC_ENTER BUTTON_RC_ON -#define TREE_RC_RUN BUTTON_RC_ON +//#define TREE_RC_ENTER BUTTON_RC_ON +#define TREE_RC_RUN (BUTTON_RC_ON | BUTTON_REL) +#define TREE_RC_RUN_PRE BUTTON_RC_ON #define TREE_RC_MENU BUTTON_RC_MENU +#define TREE_RC_WPS (BUTTON_RC_VOL | BUTTON_REL) +#define TREE_RC_WPS_PRE BUTTON_RC_VOL +#define TREE_RC_CONTEXT (BUTTON_RC_ON | BUTTON_REPEAT) #elif CONFIG_KEYPAD == RECORDER_PAD #define TREE_NEXT BUTTON_DOWN diff --git a/apps/wps.c b/apps/wps.c index 783f2528ba..9848be0965 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -470,9 +470,16 @@ long wps_show(void) switch(button) { +#ifdef WPS_RC_BROWSE + case WPS_RC_BROWSE: +#endif case WPS_BROWSE: #ifdef WPS_BROWSE_PRE - if (lastbutton != WPS_BROWSE_PRE) + if ((lastbutton != WPS_BROWSE_PRE) +#ifdef WPS_RC_BROWSE_PRE + && (lastbutton != WPS_RC_BROWSE_PRE) +#endif + ) break; #endif #ifdef HAVE_LCD_CHARCELLS diff --git a/apps/wps.h b/apps/wps.h index 091ec80553..2a2df85d2e 100644 --- a/apps/wps.h +++ b/apps/wps.h @@ -48,6 +48,8 @@ #define WPS_RC_EXIT BUTTON_RC_STOP #define WPS_RC_MENU (BUTTON_RC_MENU | BUTTON_REL) #define WPS_RC_MENU_PRE BUTTON_RC_MENU +#define WPS_RC_BROWSE (BUTTON_RC_VOL | BUTTON_REL) +#define WPS_RC_BROWSE_PRE BUTTON_RC_VOL #elif CONFIG_KEYPAD == RECORDER_PAD #define WPS_NEXT (BUTTON_RIGHT | BUTTON_REL) |