1
0
Fork 0
forked from len0rd/rockbox

Fixes: (1) Selecting previous file/dir via remote in browser works again (typo). (2) The resume request should now always work as intended, properly ignoring button releases. The power button (ON for recorder/player, OFF for ondio) is now only ignored until the first release.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5337 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2004-10-24 20:32:15 +00:00
parent ce82d8b8c8
commit 821e625e74
2 changed files with 28 additions and 9 deletions

View file

@ -739,6 +739,7 @@ static bool ask_resume(bool ask_once)
{ {
int button; int button;
bool stop = false; bool stop = false;
static bool ignore_power = true;
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
lcd_double_height(false); lcd_double_height(false);
@ -767,22 +768,35 @@ static bool ask_resume(bool ask_once)
while (!stop) { while (!stop) {
button = button_get(true); button = button_get(true);
switch (button) { switch (button) {
#ifdef TREE_RUN_PRE
case TREE_RUN_PRE: /* catch the press, not the release */
#else
case TREE_RUN: case TREE_RUN:
#endif
#ifdef TREE_RC_RUN #ifdef TREE_RC_RUN
case TREE_RC_RUN: case TREE_RC_RUN:
#endif #endif
ignore_power = false;
/* Don't ignore the power button for subsequent calls */
return true; return true;
#ifdef BUTTON_ON #ifdef TREE_POWER_BTN
/* ignore the ON button, since it might /* Initially ignore the button which powers on the box. It
still be pressed since booting */ might still be pressed since booting. */
case BUTTON_ON: case TREE_POWER_BTN:
case BUTTON_ON | BUTTON_REL: case TREE_POWER_BTN | BUTTON_REPEAT:
case BUTTON_ON | BUTTON_REPEAT: if(!ignore_power)
stop = true;
break;
/* No longer ignore the power button after it was released */
case TREE_POWER_BTN | BUTTON_REL:
ignore_power = false;
break; break;
#endif #endif
/* Handle sys events, ignore button releases */
default: default:
if(default_event_handler(button) || (button & BUTTON_REL)) if(default_event_handler(button) || !(button & BUTTON_REL))
stop = true; stop = true;
break; break;
} }
@ -793,6 +807,8 @@ static bool ask_resume(bool ask_once)
settings_save(); settings_save();
} }
ignore_power = false;
/* Don't ignore the power button for subsequent calls */
return false; return false;
} }

View file

@ -36,9 +36,10 @@
#define TREE_PGDN (BUTTON_ON | BUTTON_DOWN) #define TREE_PGDN (BUTTON_ON | BUTTON_DOWN)
#define TREE_CONTEXT (BUTTON_PLAY | BUTTON_REPEAT) #define TREE_CONTEXT (BUTTON_PLAY | BUTTON_REPEAT)
#define TREE_CONTEXT2 (BUTTON_ON | BUTTON_PLAY) #define TREE_CONTEXT2 (BUTTON_ON | BUTTON_PLAY)
#define TREE_POWER_BTN BUTTON_ON
#define TREE_RC_NEXT BUTTON_RC_RIGHT #define TREE_RC_NEXT BUTTON_RC_RIGHT
#define TREE_RC_REV BUTTON_RC_LEFT #define TREE_RC_PREV BUTTON_RC_LEFT
#define TREE_RC_EXIT BUTTON_RC_STOP #define TREE_RC_EXIT BUTTON_RC_STOP
#define TREE_RC_ENTER BUTTON_RC_PLAY #define TREE_RC_ENTER BUTTON_RC_PLAY
#define TREE_RC_RUN BUTTON_RC_PLAY #define TREE_RC_RUN BUTTON_RC_PLAY
@ -54,9 +55,10 @@
#define TREE_WPS_PRE BUTTON_ON #define TREE_WPS_PRE BUTTON_ON
#define TREE_CONTEXT (BUTTON_PLAY | BUTTON_REPEAT) #define TREE_CONTEXT (BUTTON_PLAY | BUTTON_REPEAT)
#define TREE_CONTEXT2 (BUTTON_ON | BUTTON_PLAY) #define TREE_CONTEXT2 (BUTTON_ON | BUTTON_PLAY)
#define TREE_POWER_BTN BUTTON_ON
#define TREE_RC_NEXT BUTTON_RC_RIGHT #define TREE_RC_NEXT BUTTON_RC_RIGHT
#define TREE_RC_REV BUTTON_RC_LEFT #define TREE_RC_PREV BUTTON_RC_LEFT
#define TREE_RC_EXIT BUTTON_RC_STOP #define TREE_RC_EXIT BUTTON_RC_STOP
#define TREE_RC_ENTER BUTTON_RC_PLAY #define TREE_RC_ENTER BUTTON_RC_PLAY
#define TREE_RC_RUN BUTTON_RC_PLAY #define TREE_RC_RUN BUTTON_RC_PLAY
@ -71,6 +73,7 @@
#define TREE_WPS (BUTTON_MENU | BUTTON_REL) #define TREE_WPS (BUTTON_MENU | BUTTON_REL)
#define TREE_WPS_PRE BUTTON_MENU #define TREE_WPS_PRE BUTTON_MENU
#define TREE_CONTEXT (BUTTON_RIGHT | BUTTON_REPEAT) #define TREE_CONTEXT (BUTTON_RIGHT | BUTTON_REPEAT)
#define TREE_POWER_BTN BUTTON_OFF
#endif #endif