summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-04-23 09:21:37 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-04-23 09:21:37 +0000
commit28cce684a3f433200e5257eb929ee8d7a63b67ff (patch)
tree6afe48a8bd53bac805e6ae19dd58f6843af5ccf1 /apps
parent86587527f52db8320f8d8ea48dfc76d3d93d79c8 (diff)
Changed remote control button events to separate codes. Now the remote control works while keys are locked.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3586 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/wormlet.c4
-rw-r--r--apps/tree.c10
-rw-r--r--apps/wps.c17
3 files changed, 24 insertions, 7 deletions
diff --git a/apps/recorder/wormlet.c b/apps/recorder/wormlet.c
index d6850dc039..2937a1bb83 100644
--- a/apps/recorder/wormlet.c
+++ b/apps/recorder/wormlet.c
@@ -1348,11 +1348,11 @@ static bool run(void)
player2_dir = (player2_dir + 1) % 4;
break;
- case BUTTON_VOL_UP:
+ case BUTTON_RC_VOL_UP:
player3_dir = (player3_dir + 1) % 4;
break;
- case BUTTON_VOL_DOWN:
+ case BUTTON_RC_VOL_DOWN:
player3_dir = (player3_dir + 3) % 4;
break;
diff --git a/apps/tree.c b/apps/tree.c
index a29cc5e420..7abafe8f4a 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -521,6 +521,7 @@ bool ask_resume(void)
switch (button_get(true)) {
case BUTTON_PLAY:
+ case BUTTON_RC_PLAY:
return true;
case SYS_USB_CONNECTED:
@@ -686,6 +687,7 @@ static bool handle_on(int* ds, int* dc, int numentries, int tree_max_on_screen)
while (!exit) {
switch (button_get(true)) {
case TREE_PREV:
+ case BUTTON_RC_LEFT:
case BUTTON_ON | TREE_PREV:
case BUTTON_ON | TREE_PREV | BUTTON_REPEAT:
used = true;
@@ -699,6 +701,7 @@ static bool handle_on(int* ds, int* dc, int numentries, int tree_max_on_screen)
break;
case TREE_NEXT:
+ case BUTTON_RC_RIGHT:
case BUTTON_ON | TREE_NEXT:
case BUTTON_ON | TREE_NEXT | BUTTON_REPEAT:
used = true;
@@ -714,6 +717,7 @@ static bool handle_on(int* ds, int* dc, int numentries, int tree_max_on_screen)
case BUTTON_PLAY:
+ case BUTTON_RC_PLAY:
case BUTTON_ON | BUTTON_PLAY:
if (currdir[1])
snprintf(buf, sizeof buf, "%s/%s",
@@ -804,6 +808,7 @@ bool dirbrowse(char *root)
button = button_get_w_tmo(HZ/5);
switch ( button ) {
case TREE_EXIT:
+ case BUTTON_RC_STOP:
case TREE_EXIT | BUTTON_REPEAT:
i=strlen(currdir);
if (i>1) {
@@ -848,6 +853,7 @@ bool dirbrowse(char *root)
case TREE_ENTER:
case TREE_ENTER | BUTTON_REPEAT:
+ case BUTTON_RC_PLAY:
#ifdef HAVE_RECORDER_KEYPAD
case BUTTON_PLAY:
case BUTTON_PLAY | BUTTON_REPEAT:
@@ -1005,7 +1011,7 @@ bool dirbrowse(char *root)
case TREE_PREV:
case TREE_PREV | BUTTON_REPEAT:
- case BUTTON_VOL_UP:
+ case BUTTON_RC_VOL_UP:
if(filesindir) {
if(dircursor) {
put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, false);
@@ -1043,7 +1049,7 @@ bool dirbrowse(char *root)
case TREE_NEXT:
case TREE_NEXT | BUTTON_REPEAT:
- case BUTTON_VOL_DOWN:
+ case BUTTON_RC_VOL_DOWN:
if(filesindir)
{
if (dircursor + dirstart + 1 < numentries ) {
diff --git a/apps/wps.c b/apps/wps.c
index 0fbe8d713e..a82ebc1a80 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -574,7 +574,7 @@ static bool menu(void)
case BUTTON_MENU | BUTTON_REL:
#endif
exit = true;
- if ( !last_button ) {
+ if ( !last_button && !keys_locked ) {
lcd_stop_scroll();
if (main_menu())
@@ -807,6 +807,13 @@ int wps_show(void)
continue;
}
+ /* ignore non-remote buttons when keys are locked */
+ if (keys_locked &&
+ ! ((button & BUTTON_F1) ||
+ (button == SYS_USB_CONNECTED) ||
+ (button & BUTTON_REMOTE)))
+ continue;
+
switch(button)
{
case BUTTON_ON:
@@ -848,6 +855,7 @@ int wps_show(void)
/* play/pause */
case BUTTON_PLAY:
+ case BUTTON_RC_PLAY:
if ( paused )
{
paused = false;
@@ -879,7 +887,7 @@ int wps_show(void)
case BUTTON_UP:
case BUTTON_UP | BUTTON_REPEAT:
#endif
- case BUTTON_VOL_UP:
+ case BUTTON_RC_VOL_UP:
global_settings.volume++;
if(global_settings.volume > mpeg_sound_max(SOUND_VOLUME))
global_settings.volume = mpeg_sound_max(SOUND_VOLUME);
@@ -893,7 +901,7 @@ int wps_show(void)
case BUTTON_DOWN:
case BUTTON_DOWN | BUTTON_REPEAT:
#endif
- case BUTTON_VOL_DOWN:
+ case BUTTON_RC_VOL_DOWN:
global_settings.volume--;
if(global_settings.volume < mpeg_sound_min(SOUND_VOLUME))
global_settings.volume = mpeg_sound_min(SOUND_VOLUME);
@@ -909,6 +917,7 @@ int wps_show(void)
break;
/* prev / restart */
+ case BUTTON_RC_LEFT:
case BUTTON_LEFT | BUTTON_REL:
#ifdef HAVE_RECORDER_KEYPAD
if ( lastbutton != BUTTON_LEFT )
@@ -929,6 +938,7 @@ int wps_show(void)
break;
/* next */
+ case BUTTON_RC_RIGHT:
case BUTTON_RIGHT | BUTTON_REL:
#ifdef HAVE_RECORDER_KEYPAD
if ( lastbutton != BUTTON_RIGHT )
@@ -973,6 +983,7 @@ int wps_show(void)
#ifdef HAVE_RECORDER_KEYPAD
case BUTTON_OFF:
#else
+ case BUTTON_RC_STOP:
case BUTTON_STOP | BUTTON_REL:
if ( lastbutton != BUTTON_STOP )
break;