diff options
-rw-r--r-- | apps/recorder/wormlet.c | 4 | ||||
-rw-r--r-- | apps/tree.c | 10 | ||||
-rw-r--r-- | apps/wps.c | 17 | ||||
-rw-r--r-- | firmware/drivers/serial.c | 16 | ||||
-rw-r--r-- | firmware/export/button.h | 22 |
5 files changed, 39 insertions, 30 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; diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c index 982b99fc2c..5ea807abb4 100644 --- a/firmware/drivers/serial.c +++ b/firmware/drivers/serial.c @@ -91,31 +91,27 @@ int remote_control_rx(void) switch (btn) { case STOP: -#ifdef HAVE_RECORDER_KEYPAD - last_valid_button = BUTTON_OFF; -#else - last_valid_button = BUTTON_STOP; -#endif + last_valid_button = BUTTON_RC_STOP; break; case PLAY: - last_valid_button = BUTTON_PLAY; + last_valid_button = BUTTON_RC_PLAY; break; case VOLUP: - last_valid_button = BUTTON_VOL_UP; + last_valid_button = BUTTON_RC_VOL_UP; break; case VOLDN: - last_valid_button = BUTTON_VOL_DOWN; + last_valid_button = BUTTON_RC_VOL_DOWN; break; case PREV: - last_valid_button = BUTTON_LEFT; + last_valid_button = BUTTON_RC_LEFT; break; case NEXT: - last_valid_button = BUTTON_RIGHT; + last_valid_button = BUTTON_RC_RIGHT; break; #ifdef SCREENDUMP diff --git a/firmware/export/button.h b/firmware/export/button.h index c980e2e36c..e3c37f9382 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h @@ -1,3 +1,4 @@ + /*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ @@ -37,16 +38,18 @@ int button_get_w_tmo(int ticks); #define BUTTON_LEFT 0x0040 #define BUTTON_RIGHT 0x0080 -/* remote control buttons */ -#define BUTTON_VOL_UP 0x1000 -#define BUTTON_VOL_DOWN 0x1001 - /* Button modifiers */ +#define BUTTON_REMOTE 0x2000 #define BUTTON_REPEAT 0x4000 #define BUTTON_REL 0x8000 -/* Special message */ -#define BUTTON_LOCKED 0x2000 +/* remote control buttons */ +#define BUTTON_RC_VOL_UP (0x0008 | BUTTON_REMOTE) +#define BUTTON_RC_VOL_DOWN (0x0800 | BUTTON_REMOTE) +#define BUTTON_RC_PLAY (BUTTON_UP | BUTTON_REMOTE) +#define BUTTON_RC_STOP (BUTTON_DOWN | BUTTON_REMOTE) +#define BUTTON_RC_LEFT (BUTTON_LEFT | BUTTON_REMOTE) +#define BUTTON_RC_RIGHT (BUTTON_RIGHT| BUTTON_REMOTE) #ifdef HAVE_RECORDER_KEYPAD @@ -57,10 +60,6 @@ int button_get_w_tmo(int ticks); #define BUTTON_F2 0x0200 #define BUTTON_F3 0x0400 -#define ALL_BUTTONS (BUTTON_ON | BUTTON_UP | BUTTON_DOWN | BUTTON_LEFT | \ - BUTTON_RIGHT | BUTTON_OFF | BUTTON_PLAY | BUTTON_F1 | \ - BUTTON_F2 | BUTTON_F3) - #elif HAVE_PLAYER_KEYPAD /* Jukebox 6000 and Studio specific button codes */ @@ -68,9 +67,6 @@ int button_get_w_tmo(int ticks); #define BUTTON_PLAY BUTTON_UP #define BUTTON_STOP BUTTON_DOWN -#define ALL_BUTTONS (BUTTON_ON | BUTTON_UP | BUTTON_DOWN | BUTTON_LEFT | \ - BUTTON_RIGHT | BUTTON_MENU) - #endif /* HAVE_PLAYER_KEYPAD */ #endif |