From 224c0a13ebb5828b9bc06a9c1c23ae17f0ac19f9 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 15 Aug 2006 12:27:07 +0000 Subject: Finally, the new button action system is here, thanks to Jonathan Gordon. Some button mappings have changed and other things may break. Comments should go to the forum, http://forums.rockbox.org/index.php?topic=5829.0 or the mailing list. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10582 a1c6a512-1295-4272-9138-f99709370657 --- apps/menu.c | 42 +++++++----------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) (limited to 'apps/menu.c') diff --git a/apps/menu.c b/apps/menu.c index a1c70824ce..f861e0bddf 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -40,6 +40,7 @@ #include "talk.h" #include "lang.h" #include "misc.h" +#include "action.h" #ifdef HAVE_LCD_BITMAP #include "icons.h" @@ -124,13 +125,12 @@ int menu_show(int m) #endif bool exit = false; int key; - unsigned lastbutton = 0; gui_synclist_draw(&(menus[m].synclist)); gui_syncstatusbar_draw(&statusbars, true); menu_talk_selected(m); while (!exit) { - key = button_get_w_tmo(HZ/2); + key = get_action(CONTEXT_MAINMENU,HZ/2); /* * "short-circuit" the default keypresses by running the * callback function @@ -144,40 +144,13 @@ int menu_show(int m) if(gui_synclist_do_button(&(menus[m].synclist), key)) menu_talk_selected(m); switch( key ) { - case MENU_ENTER | BUTTON_REL: - if (lastbutton != MENU_ENTER) - break; -#ifdef MENU_ENTER2 - case MENU_ENTER2: -#endif -#ifdef MENU_RC_ENTER - case MENU_RC_ENTER: -#endif -#ifdef MENU_RC_ENTER2 - case MENU_RC_ENTER2: -#endif + case ACTION_STD_OK: + action_signalscreenchange(); return gui_synclist_get_sel_pos(&(menus[m].synclist)); - case MENU_EXIT | BUTTON_REL: - if (lastbutton != MENU_EXIT) - break; -#ifdef MENU_EXIT2 - case MENU_EXIT2: -#endif -#ifdef MENU_EXIT_MENU - case MENU_EXIT_MENU | BUTTON_REL: - /* This is important for the Ondio's */ - if ((key == (MENU_EXIT_MENU | BUTTON_REL)) && - (lastbutton != MENU_EXIT_MENU)) - break; -#endif -#ifdef MENU_RC_EXIT - case MENU_RC_EXIT: -#endif -#ifdef MENU_RC_EXIT_MENU - case MENU_RC_EXIT_MENU: -#endif + case ACTION_STD_CANCEL: + case ACTION_STD_MENU: exit = true; break; @@ -187,9 +160,8 @@ int menu_show(int m) break; } gui_syncstatusbar_draw(&statusbars, false); - if ( key ) - lastbutton = key; } + action_signalscreenchange(); return MENU_SELECTED_EXIT; } -- cgit v1.2.3