Make remote-control code more complete

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6696 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Marcoen Hirschberg 2005-06-12 20:18:37 +00:00
parent 7eb743e881
commit fb369b063b
5 changed files with 48 additions and 8 deletions

View file

@ -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 &&

View file

@ -468,8 +468,13 @@ 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 */
@ -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;
@ -746,11 +754,18 @@ static bool dirbrowse(void)
#endif
#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

View file

@ -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

View file

@ -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

View file

@ -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)