From d12f81ddd4a0cdd76d08540b70068b3cb2c985ed Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 21 Aug 2006 07:03:15 +0000 Subject: [PATCH] fixed the settings action context, time/eq/colour chooser/dbug screens should all work correctly again git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10670 a1c6a512-1295-4272-9138-f99709370657 --- apps/action.h | 35 +++++++++++++----- apps/bookmark.c | 14 ++++---- apps/eq_menu.c | 14 +++----- apps/gui/color_picker.c | 4 ++- apps/keymaps/keymap-h10.c | 15 ++++---- apps/keymaps/keymap-h1x0_h3x0.c | 63 +++++++++++++++++++++++---------- apps/keymaps/keymap-ifp7xx.c | 13 ++++--- apps/keymaps/keymap-ipod.c | 23 ++++++------ apps/keymaps/keymap-ondio.c | 10 +++--- apps/keymaps/keymap-recorder.c | 6 +++- apps/keymaps/keymap-x5.c | 15 ++++---- apps/screens.c | 4 ++- 12 files changed, 140 insertions(+), 76 deletions(-) diff --git a/apps/action.h b/apps/action.h index a74a2e145d..147b1532b7 100644 --- a/apps/action.h +++ b/apps/action.h @@ -46,13 +46,25 @@ enum { CONTEXT_ID3DB = 5, /* Add new contexts here, no need to explicitly define a value for them */ CONTEXT_LIST, - CONTEXT_SETTINGS, /* options style settings, like from menus */ - CONTEXT_SETTINGSGRAPHICAL, /* screens like eq config and colour chooser */ + CONTEXT_SETTINGS, /* regular setting screens (and debug screens) */ + /* bellow are setting screens which may need to redefine the standard + setting screen keys, targets should return the CONTEXT_SETTINGS + keymap unless they are not adequate for the screen + NOTE: uses ACTION_STD_[NEXT|PREV] so make sure they are there also + and (possibly) ACTION_SETTINGS_[INC|DEC] */ + CONTEXT_SETTINGS_EQ, + CONTEXT_SETTINGS_COLOURCHOOSER, + CONTEXT_SETTINGS_TIME, - CONTEXT_YESNOSCREEN, /*NOTE: make sure your target has this and ACTION_YESNO_ACCEPT */ - CONTEXT_BOOKMARKSCREEN, /*NOTE: requires the action_setting_* mappings also */ + /* The following contexts should use ACTION_STD_[NEXT|PREV] + and (possibly) ACTION_SETTINGS_[INC|DEC] + Also add any extra actions they need */ + CONTEXT_BOOKMARKSCREEN, /* uses ACTION_BMS_ defines */ + CONTEXT_ALARMSCREEN, /* uses ACTION_AS_ defines */ CONTEXT_QUICKSCREEN, /* uses ACTION_QS_ defines below */ CONTEXT_PITCHSCREEN, /* uses ACTION_PS_ defines below */ + + CONTEXT_YESNOSCREEN, /*NOTE: make sure your target has this and ACTION_YESNO_ACCEPT */ CONTEXT_RECSCREEN, }; @@ -127,15 +139,19 @@ enum { /* settings */ ACTION_SETTINGS_INC, ACTION_SETTINGS_INCREPEAT, + ACTION_SETTINGS_INCBIGSTEP, ACTION_SETTINGS_DEC, ACTION_SETTINGS_DECREPEAT, - - /* yesno screen */ - ACTION_YESNO_ACCEPT, + ACTION_SETTINGS_DECBIGSTEP, + ACTION_SETTINGS_RESET, /* bookmark screen */ - ACTION_BMARK_DELETE, + ACTION_BMS_SELECT, + ACTION_BMS_DELETE, + ACTION_BMS_EXIT, + /* alarm menu screen */ + /* quickscreen */ ACTION_QS_LEFT, ACTION_QS_RIGHT, @@ -155,6 +171,9 @@ enum { ACTION_PS_RESET, ACTION_PS_EXIT, /* _STD_* isnt going to work here */ + /* yesno screen */ + ACTION_YESNO_ACCEPT, + }; diff --git a/apps/bookmark.c b/apps/bookmark.c index 8c30ec1466..412ecdea6e 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c @@ -571,7 +571,7 @@ static char* select_bookmark(const char* bookmark_file_name) #endif bookmark_count = get_bookmark_count(bookmark_file_name); - + action_signalscreenchange(); while(true) { if(bookmark_id < 0) @@ -612,7 +612,7 @@ static char* select_bookmark(const char* bookmark_file_name) key = get_action(CONTEXT_BOOKMARKSCREEN,TIMEOUT_BLOCK); switch(key) { - case ACTION_STD_OK: + case ACTION_BMS_SELECT: /* User wants to use this bookmark */ #ifdef HAVE_LCD_BITMAP if (global_settings.statusbar) @@ -629,7 +629,7 @@ static char* select_bookmark(const char* bookmark_file_name) action_signalscreenchange(); return bookmark; - case ACTION_BMARK_DELETE: + case ACTION_BMS_DELETE: /* User wants to delete this bookmark */ delete_bookmark(bookmark_file_name, bookmark_id); bookmark_id_prev=-2; @@ -638,15 +638,17 @@ static char* select_bookmark(const char* bookmark_file_name) bookmark_id = bookmark_count -1; break; - case ACTION_SETTINGS_DEC: + case ACTION_STD_PREV: + case ACTION_STD_PREVREPEAT: bookmark_id--; break; - case ACTION_SETTINGS_INC: + case ACTION_STD_NEXT: + case ACTION_STD_NEXTREPEAT: bookmark_id++; break; - case ACTION_STD_CANCEL: + case ACTION_BMS_EXIT: #ifdef HAVE_LCD_BITMAP FOR_NB_SCREENS(i) screens[i].setmargins(x, y); diff --git a/apps/eq_menu.c b/apps/eq_menu.c index 7c8b1590c3..0743490723 100644 --- a/apps/eq_menu.c +++ b/apps/eq_menu.c @@ -619,7 +619,7 @@ bool eq_menu_graphical(void) screens[i].update(); } - button = get_action(CONTEXT_SETTINGSGRAPHICAL,TIMEOUT_BLOCK); + button = get_action(CONTEXT_SETTINGS_EQ,TIMEOUT_BLOCK); switch (button) { case ACTION_SETTINGS_DEC: @@ -638,23 +638,19 @@ bool eq_menu_graphical(void) *(setting) = max; break; -#ifdef EQ_BTN_MODIFIER - case EQ_BTN_MODIFIER | EQ_BTN_INCREMENT: - case EQ_BTN_MODIFIER | EQ_BTN_INCREMENT | BUTTON_REPEAT: + case ACTION_SETTINGS_INCBIGSTEP: *(setting) += fast_step; has_changed = true; if (*(setting) > max) *(setting) = max; break; - case EQ_BTN_MODIFIER | EQ_BTN_DECREMENT: - case EQ_BTN_MODIFIER | EQ_BTN_DECREMENT | BUTTON_REPEAT: + case ACTION_SETTINGS_DECBIGSTEP: *(setting) -= fast_step; has_changed = true; if (*(setting) < min) *(setting) = min; break; -#endif case ACTION_STD_PREV: case ACTION_STD_PREVREPEAT: @@ -670,13 +666,13 @@ bool eq_menu_graphical(void) current_band = 0; /* wrap around */ break; - case ACTION_STD_OK: + case ACTION_STD_OK: mode++; if (mode > Q) mode = GAIN; /* wrap around */ break; - case ACTION_STD_CANCEL: + case ACTION_STD_CANCEL: exit_request = true; result = false; break; diff --git a/apps/gui/color_picker.c b/apps/gui/color_picker.c index 3decd30207..1217fcd08c 100644 --- a/apps/gui/color_picker.c +++ b/apps/gui/color_picker.c @@ -184,14 +184,16 @@ bool set_color(struct screen *display,char *title, int* color, int banned_color) draw_screen(&screens[i], title, rgb_val, newcolor, slider); } - button = get_action(CONTEXT_SETTINGSGRAPHICAL,TIMEOUT_BLOCK); + button = get_action(CONTEXT_SETTINGS_COLOURCHOOSER,TIMEOUT_BLOCK); switch (button) { case ACTION_STD_PREV: + case ACTION_STD_PREVREPEAT: slider = (slider+2)%3; break; case ACTION_STD_NEXT: + case ACTION_STD_NEXTREPEAT: slider = (slider+1)%3; break; diff --git a/apps/keymaps/keymap-h10.c b/apps/keymaps/keymap-h10.c index 029615faa5..db55f825e9 100644 --- a/apps/keymaps/keymap-h10.c +++ b/apps/keymaps/keymap-h10.c @@ -100,7 +100,7 @@ const struct button_mapping button_context_tree_scroll_lr[] = { { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1), + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), }; /* button_context_tree_scroll_lr */ const struct button_mapping button_context_yesno[] = { @@ -122,7 +122,7 @@ const struct button_mapping button_context_quickscreen[] = { LAST_ITEM_IN_LIST }; /* button_context_quickscreen */ -const struct button_mapping button_context_settingsgraphical[] = { +const struct button_mapping button_context_settings_r_is_inc[] = { { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, @@ -135,7 +135,7 @@ const struct button_mapping button_context_settingsgraphical[] = { { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, LAST_ITEM_IN_LIST -}; /* button_context_settingsgraphical */ +}; /* button_context_settings_r_is_inc */ const struct button_mapping button_context_pitchscreen[] = { { ACTION_PS_INC_SMALL, BUTTON_SCROLL_UP, BUTTON_NONE }, @@ -165,8 +165,11 @@ const struct button_mapping* get_context_mapping(int context) case CONTEXT_WPS: return button_context_wps; - case CONTEXT_SETTINGSGRAPHICAL: - return button_context_settingsgraphical; + case CONTEXT_SETTINGS_EQ: + case CONTEXT_SETTINGS_TIME: + case CONTEXT_SETTINGS_COLOURCHOOSER: + case CONTEXT_CUSTOM|CONTEXT_SETTINGS: + return button_context_settings_r_is_inc; case CONTEXT_SETTINGS: return button_context_settings; @@ -177,7 +180,7 @@ const struct button_mapping* get_context_mapping(int context) if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; /* else fall through to CUSTOM|1 */ - case CONTEXT_CUSTOM|1: + case CONTEXT_CUSTOM|CONTEXT_TREE: return button_context_tree; case CONTEXT_QUICKSCREEN: return button_context_quickscreen; diff --git a/apps/keymaps/keymap-h1x0_h3x0.c b/apps/keymaps/keymap-h1x0_h3x0.c index d7096cb5c0..b68aed8a37 100644 --- a/apps/keymaps/keymap-h1x0_h3x0.c +++ b/apps/keymaps/keymap-h1x0_h3x0.c @@ -38,7 +38,9 @@ /* CONTEXT_CUSTOM's used in this file... CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) - +CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens + i.e where up/down is inc/dec + CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec */ @@ -51,12 +53,14 @@ const struct button_mapping button_context_standard[] = { { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, { ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE }, + { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT }, { ACTION_STD_QUICKSCREEN, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE }, { ACTION_STD_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE }, { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_STD_OK, BUTTON_ON|BUTTON_REL, BUTTON_NONE }, LAST_ITEM_IN_LIST }; /* button_context_standard */ @@ -138,13 +142,16 @@ const struct button_mapping button_context_settings[] = { { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_RESET, BUTTON_ON, BUTTON_NONE }, LAST_ITEM_IN_LIST }; /* button_context_settings */ -const struct button_mapping button_context_settingsgraphical[] = { +const struct button_mapping button_context_settings_right_is_inc[] = { { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, @@ -153,6 +160,7 @@ const struct button_mapping button_context_settingsgraphical[] = { { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_RESET, BUTTON_ON, BUTTON_NONE }, LAST_ITEM_IN_LIST }; /* button_context_settingsgraphical */ @@ -162,10 +170,26 @@ const struct button_mapping button_context_yesno[] = { LAST_ITEM_IN_LIST }; /* button_context_settings_yesno */ +const struct button_mapping button_context_colorchooser[] = { + { ACTION_STD_OK, BUTTON_ON|BUTTON_REL, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), +}; /* button_context_settings_bmark */ + +const struct button_mapping button_context_eq[] = { + { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), +}; /* button_context_settings_bmark */ + const struct button_mapping button_context_bmark[] = { - { ACTION_BMARK_DELETE, BUTTON_REC, BUTTON_NONE }, + { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_SELECT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGSGRAPHICAL), + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), +}; /* button_context_settings_bmark */ + +const struct button_mapping button_context_time[] = { + { ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE }, + { ACTION_STD_OK, BUTTON_ON, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), }; /* button_context_settings_bmark */ const struct button_mapping button_context_quickscreen[] = { @@ -419,15 +443,15 @@ const struct button_mapping *button_context_yesno_h300lcdremote = button_context_yesno_h100remote; const struct button_mapping button_context_bmark_h100remote[] = { - { ACTION_BMARK_DELETE, BUTTON_RC_REC, BUTTON_NONE }, + { ACTION_BMS_DELETE, BUTTON_RC_REC, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_RC_ON, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGSGRAPHICAL|CONTEXT_REMOTE), + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS|CONTEXT_REMOTE), }; /* button_context_settings_bmark */ const struct button_mapping button_context_bmark_h300lcdremote[] = { - { ACTION_BMARK_DELETE, BUTTON_RC_REC, BUTTON_NONE }, + { ACTION_BMS_DELETE, BUTTON_RC_REC, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_RC_MENU, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGSGRAPHICAL|CONTEXT_REMOTE), + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS|CONTEXT_REMOTE), }; const struct button_mapping button_context_quickscreen_h100remote[] = { @@ -669,9 +693,6 @@ const struct button_mapping* get_context_mapping_remote(int context) return remote_btn_ctxt_listtree_scroll_w_cmb; case CONTEXT_CUSTOM|CONTEXT_TREE: return remote_btn_ctxt_tree; - - case CONTEXT_SETTINGSGRAPHICAL: - return remote_btn_ctxt_settingsgrph; case CONTEXT_SETTINGS: return remote_btn_ctxt_settings; @@ -713,16 +734,22 @@ const struct button_mapping* get_context_mapping(int context) return button_context_listtree_scroll_with_combo; case CONTEXT_CUSTOM|CONTEXT_TREE: return button_context_tree; - - case CONTEXT_SETTINGSGRAPHICAL: - return button_context_settingsgraphical; case CONTEXT_SETTINGS: return button_context_settings; + case CONTEXT_CUSTOM|CONTEXT_SETTINGS: + return button_context_settings_right_is_inc; + + case CONTEXT_SETTINGS_COLOURCHOOSER: + return button_context_colorchooser; + case CONTEXT_SETTINGS_EQ: + return button_context_eq; + + case CONTEXT_SETTINGS_TIME: + return button_context_time; case CONTEXT_YESNOSCREEN: - return button_context_yesno; - + return button_context_yesno; case CONTEXT_BOOKMARKSCREEN: return button_context_bmark; case CONTEXT_QUICKSCREEN: diff --git a/apps/keymaps/keymap-ifp7xx.c b/apps/keymaps/keymap-ifp7xx.c index 1da4f0974c..359aa5b6e2 100644 --- a/apps/keymaps/keymap-ifp7xx.c +++ b/apps/keymaps/keymap-ifp7xx.c @@ -82,7 +82,7 @@ const struct button_mapping button_context_settings[] = { LAST_ITEM_IN_LIST }; /* button_context_settings */ -const struct button_mapping button_context_settingsgraphical[] = { +const struct button_mapping button_context_settings_r_is_inc[] = { { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, @@ -101,9 +101,9 @@ const struct button_mapping button_context_yesno[] = { }; /* button_context_settings_yesno */ const struct button_mapping button_context_bmark[] = { - { ACTION_BMARK_DELETE, BUTTON_MODE, BUTTON_NONE }, + { ACTION_BMS_DELETE, BUTTON_MODE, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_SELECT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGSGRAPHICAL), + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), }; /* button_context_settings_bmark */ const struct button_mapping button_context_quickscreen[] = { @@ -143,8 +143,11 @@ const struct button_mapping* get_context_mapping(int context) return button_context_standard; case CONTEXT_WPS: return button_context_wps; - case CONTEXT_SETTINGSGRAPHICAL: - return button_context_settingsgraphical; + case CONTEXT_CUSTOM|CONTEXT_SETTINGS: + case CONTEXT_SETTINGS_EQ: + case CONTEXT_SETTINGS_COLOURCHOOSER: + case CONTEXT_SETTINGS_TIME: + return button_context_settings_r_is_inc; case CONTEXT_SETTINGS: return button_context_settings; case CONTEXT_YESNOSCREEN: diff --git a/apps/keymaps/keymap-ipod.c b/apps/keymaps/keymap-ipod.c index 6cc6de6e1c..4f4ac4ad33 100644 --- a/apps/keymaps/keymap-ipod.c +++ b/apps/keymaps/keymap-ipod.c @@ -32,7 +32,7 @@ /* CONTEXT_CUSTOM's used in this file... -CONTEXT_CUSTOM|1 = the standard list/tree defines (without directions) +CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) */ @@ -45,11 +45,11 @@ const struct button_mapping button_context_standard[] = { { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, + { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, - { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, + { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, LAST_ITEM_IN_LIST }; /* button_context_standard */ @@ -69,7 +69,7 @@ const struct button_mapping button_context_tree_scroll_lr[] = { { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1), + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), }; const struct button_mapping button_context_wps[] = { @@ -102,7 +102,8 @@ const struct button_mapping button_context_settings[] = { { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, /* rel so bmark screen works */ + { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, LAST_ITEM_IN_LIST }; /* button_context_settings */ @@ -113,7 +114,7 @@ const struct button_mapping button_context_yesno[] = { }; /* button_context_settings_yesno */ const struct button_mapping button_context_bmark[] = { - { ACTION_BMARK_DELETE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, + { ACTION_BMS_DELETE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), }; /* button_context_settings_bmark */ @@ -157,15 +158,17 @@ const struct button_mapping* get_context_mapping(int context) case CONTEXT_TREE: if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; - /* else fall through to CUSTOM|1 */ - case CONTEXT_CUSTOM|1: + /* else fall through to CUSTOM|CONTEXT_TREE */ + case CONTEXT_CUSTOM|CONTEXT_TREE: return button_context_tree; case CONTEXT_LIST: case CONTEXT_MAINMENU: break; + case CONTEXT_SETTINGS_EQ: + case CONTEXT_SETTINGS_COLOURCHOOSER: + case CONTEXT_SETTINGS_TIME: case CONTEXT_SETTINGS: - case CONTEXT_SETTINGSGRAPHICAL: return button_context_settings; case CONTEXT_YESNOSCREEN: return button_context_yesno; diff --git a/apps/keymaps/keymap-ondio.c b/apps/keymaps/keymap-ondio.c index 57bdcc324a..141d23b5d1 100644 --- a/apps/keymaps/keymap-ondio.c +++ b/apps/keymaps/keymap-ondio.c @@ -27,7 +27,7 @@ /* CONTEXT_CUSTOM's used in this file... -CONTEXT_CUSTOM|1 = the standard list/tree defines (without directions) +CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) */ @@ -95,7 +95,7 @@ const struct button_mapping button_context_tree_scroll_lr[] = { { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1), + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), }; const struct button_mapping button_context_yesno[] = { @@ -106,7 +106,7 @@ const struct button_mapping button_context_yesno[] = { struct button_mapping button_context_bmark[] = { { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_BMARK_DELETE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, + { ACTION_BMS_DELETE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), @@ -160,8 +160,8 @@ const struct button_mapping* get_context_mapping( int context ) case CONTEXT_TREE: if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; - /* else fall through to CUSTOM|1 */ - case CONTEXT_CUSTOM|1: + /* else fall through to CUSTOM|CONTEXT_TREE */ + case CONTEXT_CUSTOM|CONTEXT_TREE: return button_context_tree; case CONTEXT_RECSCREEN: return button_context_recscreen; diff --git a/apps/keymaps/keymap-recorder.c b/apps/keymaps/keymap-recorder.c index 72e04071a9..3e6eda99fc 100644 --- a/apps/keymaps/keymap-recorder.c +++ b/apps/keymaps/keymap-recorder.c @@ -86,6 +86,10 @@ static const struct button_mapping button_context_settings[] = { { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, LAST_ITEM_IN_LIST }; @@ -204,7 +208,7 @@ const struct button_mapping* get_context_mapping( int context ) { case CONTEXT_WPS: return button_context_wps; - + case CONTEXT_SETTINGS_TIME: case CONTEXT_SETTINGS: return button_context_settings; diff --git a/apps/keymaps/keymap-x5.c b/apps/keymaps/keymap-x5.c index 3752b35f9c..e92baf4dbe 100644 --- a/apps/keymaps/keymap-x5.c +++ b/apps/keymaps/keymap-x5.c @@ -29,7 +29,7 @@ /* CONTEXT_CUSTOM's used in this file... -CONTEXT_CUSTOM|1 = the standard list/tree defines (without directions) +CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) */ @@ -104,7 +104,7 @@ const struct button_mapping button_context_tree_scroll_lr[] = { { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1), + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), }; const struct button_mapping button_context_yesno[] = { @@ -126,7 +126,7 @@ const struct button_mapping button_context_quickscreen[] = { LAST_ITEM_IN_LIST }; /* button_context_quickscreen */ -const struct button_mapping button_context_settingsgraphical[] = { +const struct button_mapping button_context_settings_r_is_inc[] = { { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, @@ -246,8 +246,10 @@ const struct button_mapping* get_context_mapping( int context ) case CONTEXT_WPS: return button_context_wps; - case CONTEXT_SETTINGSGRAPHICAL: - return button_context_settingsgraphical; + case CONTEXT_SETTINGS_EQ: + case CONTEXT_SETTINGS_COLOURCHOOSER: + case CONTEXT_SETTINGS_TIME: + return button_context_settings_r_is_inc; case CONTEXT_SETTINGS: return button_context_settings; @@ -259,7 +261,8 @@ const struct button_mapping* get_context_mapping( int context ) if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; /* else fall through to CUSTOM|1 */ - case CONTEXT_CUSTOM|1: + case CONTEXT_CUSTOM|CONTEXT_TREE + : return button_context_tree; case CONTEXT_QUICKSCREEN: return button_context_quickscreen; diff --git a/apps/screens.c b/apps/screens.c index e2e254581a..86a377ecc5 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -916,7 +916,7 @@ bool set_time_screen(const char* string, struct tm *tm) say_time(cursorpos, tm); } - button = get_action(CONTEXT_SETTINGS,HZ/2); + button = get_action(CONTEXT_SETTINGS_TIME,HZ/2); switch ( button ) { case ACTION_STD_PREV: cursorpos = (cursorpos + 6 - 1) % 6; @@ -925,6 +925,7 @@ bool set_time_screen(const char* string, struct tm *tm) cursorpos = (cursorpos + 6 + 1) % 6; break; case ACTION_SETTINGS_INC: + case ACTION_SETTINGS_INCREPEAT: *valptr = (*valptr + steps - min + 1) % steps + min; if(*valptr == 0) @@ -932,6 +933,7 @@ bool set_time_screen(const char* string, struct tm *tm) say_time(cursorpos, tm); break; case ACTION_SETTINGS_DEC: + case ACTION_SETTINGS_DECREPEAT: *valptr = (*valptr + steps - min - 1) % steps + min; if(*valptr == 0)