From 01db3ba568ba4b07b72c426709be092e443ac233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= Date: Thu, 10 Jun 2004 21:47:43 +0000 Subject: [PATCH] Keylock now locks combo keys too (mute, id3 viewer etc) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4732 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps.c | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/apps/wps.c b/apps/wps.c index f1b0e214a7..0f393a0faf 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -499,6 +499,33 @@ static bool menu(void) while (!exit) { int button = button_get(true); + + /* these are never locked */ + switch (button) + { + /* key lock */ +#ifdef HAVE_RECORDER_KEYPAD + case BUTTON_F1 | BUTTON_DOWN: +#else + case BUTTON_MENU | BUTTON_STOP: +#endif + keys_locked = !keys_locked; + display_keylock_text(keys_locked); + exit = true; + while (button_get(false)); /* clear button queue */ + break; + + case SYS_USB_CONNECTED: + status_set_playmode(STATUS_STOP); + usb_screen(); + keys_locked = false; + return true; + } + + if (keys_locked) { + display_keylock_text(true); + break; + } switch ( button ) { /* go into menu */ @@ -539,18 +566,6 @@ static bool menu(void) display_mute_text(muted); break; - /* key lock */ -#ifdef HAVE_RECORDER_KEYPAD - case BUTTON_F1 | BUTTON_DOWN: -#else - case BUTTON_MENU | BUTTON_STOP: -#endif - keys_locked = !keys_locked; - display_keylock_text(keys_locked); - exit = true; - while (button_get(false)); /* clear button queue */ - break; - #ifdef BUTTON_MENU /* change volume */ case BUTTON_MENU | BUTTON_LEFT: @@ -584,11 +599,6 @@ static bool menu(void) #endif exit = true; break; - - case SYS_USB_CONNECTED: - status_set_playmode(STATUS_STOP); - usb_screen(); - return true; } last_button = button; }