Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
Jonathan Gordon | ff469ab | 2008-05-28 10:55:39 +0000 | [diff] [blame] | 8 | * $Id$ |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 9 | * |
| 10 | * Copyright (C) 2007 Mark Arigo |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | /* Button Code Definitions for Sandisk c200 target */ |
| 22 | |
| 23 | #include "config.h" |
| 24 | #include "action.h" |
| 25 | #include "button.h" |
| 26 | #include "settings.h" |
| 27 | |
| 28 | /* {Action Code, Button code, Prereq button code } */ |
| 29 | |
| 30 | /* |
| 31 | * The format of the list is as follows |
| 32 | * { Action Code, Button code, Prereq button code } |
| 33 | * if there's no need to check the previous button's value, use BUTTON_NONE |
| 34 | * Insert LAST_ITEM_IN_LIST at the end of each mapping |
| 35 | */ |
| 36 | static const struct button_mapping button_context_standard[] = { |
| 37 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, |
| 38 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 39 | |
| 40 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, |
| 41 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 42 | |
| 43 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, |
| 44 | { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, |
| 45 | { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, |
| 46 | |
| 47 | { ACTION_STD_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, |
| 48 | { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, |
| 49 | { ACTION_STD_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE }, |
| 50 | { ACTION_STD_QUICKSCREEN, BUTTON_REC|BUTTON_SELECT, BUTTON_NONE }, |
| 51 | |
| 52 | LAST_ITEM_IN_LIST |
| 53 | }; /* button_context_standard */ |
| 54 | |
| 55 | |
| 56 | static const struct button_mapping button_context_wps[] = { |
| 57 | { ACTION_WPS_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP }, |
| 58 | { ACTION_WPS_STOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, |
| 59 | |
| 60 | { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, |
| 61 | { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 62 | { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, |
| 63 | |
| 64 | { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, |
| 65 | { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 66 | { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, |
| 67 | |
| 68 | { ACTION_WPS_ABSETB_NEXTDIR,BUTTON_POWER|BUTTON_RIGHT, BUTTON_POWER }, |
| 69 | { ACTION_WPS_ABSETA_PREVDIR,BUTTON_POWER|BUTTON_LEFT, BUTTON_POWER }, |
| 70 | { ACTION_WPS_ABRESET, BUTTON_POWER|BUTTON_UP, BUTTON_POWER }, |
| 71 | |
| 72 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, |
| 73 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 74 | |
| 75 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, |
| 76 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 77 | |
| 78 | { ACTION_WPS_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, |
| 79 | { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, |
| 80 | { ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_UP, BUTTON_SELECT }, |
| 81 | { ACTION_WPS_ID3SCREEN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_SELECT }, |
| 82 | { ACTION_WPS_CONTEXT, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN }, |
| 83 | { ACTION_WPS_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN }, |
| 84 | { ACTION_WPS_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE }, |
| 85 | |
| 86 | LAST_ITEM_IN_LIST |
| 87 | }; /* button_context_wps */ |
| 88 | |
| 89 | static const struct button_mapping button_context_settings[] = { |
| 90 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, |
| 91 | { ACTION_SETTINGS_RESET, BUTTON_SELECT, BUTTON_NONE }, |
Marianne Arnold | a04972a | 2007-09-21 17:49:43 +0000 | [diff] [blame] | 92 | |
Marianne Arnold | af97e93 | 2007-10-02 21:04:10 +0000 | [diff] [blame] | 93 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, |
| 94 | { ACTION_SETTINGS_INCREPEAT,BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 95 | |
| 96 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, |
| 97 | { ACTION_SETTINGS_DECREPEAT,BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 98 | |
| 99 | { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, |
| 100 | { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 101 | |
| 102 | { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, |
| 103 | { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 104 | |
| 105 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), |
| 106 | }; /* button_context_settings */ |
| 107 | |
| 108 | static const struct button_mapping button_context_list[] = { |
| 109 | { ACTION_LISTTREE_PGUP, BUTTON_REC|BUTTON_UP, BUTTON_REC }, |
| 110 | { ACTION_LISTTREE_PGDOWN, BUTTON_REC|BUTTON_DOWN, BUTTON_REC }, |
| 111 | |
| 112 | #ifdef HAVE_VOLUME_IN_LIST |
| 113 | { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 114 | { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, |
| 115 | |
| 116 | { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, |
| 117 | { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 118 | #endif |
| 119 | |
| 120 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 121 | }; /* button_context_list */ |
| 122 | |
| 123 | static const struct button_mapping button_context_tree[] = { |
| 124 | { ACTION_TREE_WPS, BUTTON_REC|BUTTON_UP, BUTTON_REC }, |
| 125 | { ACTION_TREE_STOP, BUTTON_REC|BUTTON_UP|BUTTON_REPEAT, BUTTON_REC|BUTTON_UP }, |
| 126 | |
| 127 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), |
| 128 | }; /* button_context_tree */ |
| 129 | |
| 130 | static const struct button_mapping button_context_listtree_scroll_without_combo[] = { |
| 131 | { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, |
| 132 | { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, |
| 133 | { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, |
| 134 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 135 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, |
| 136 | |
| 137 | { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, |
| 138 | { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, |
| 139 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 140 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, |
| 141 | |
| 142 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), |
| 143 | }; /* button_context_listtree_scroll_without_combo */ |
| 144 | |
| 145 | static const struct button_mapping button_context_listtree_scroll_with_combo[] = { |
| 146 | { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 147 | |
| 148 | { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_REC }, |
| 149 | { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 150 | |
| 151 | { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_REC }, |
| 152 | { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE }, |
| 153 | |
| 154 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), |
| 155 | }; /* button_context_listtree_scroll_with_combo */ |
| 156 | |
| 157 | static const struct button_mapping button_context_yesno[] = { |
| 158 | { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, |
| 159 | |
| 160 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), |
| 161 | }; /* button_context_settings_yesno */ |
| 162 | |
| 163 | static const struct button_mapping button_context_quickscreen[] = { |
| 164 | { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, |
| 165 | { ACTION_STD_CANCEL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE }, |
| 166 | |
| 167 | { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REL, BUTTON_NONE }, |
| 168 | { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 169 | |
| 170 | { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE }, |
| 171 | { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 172 | |
| 173 | { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, |
| 174 | { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 175 | |
| 176 | { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, |
| 177 | { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 178 | |
| 179 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), |
| 180 | }; /* button_context_quickscreen */ |
| 181 | |
| 182 | static const struct button_mapping button_context_settings_right_is_inc[] = { |
| 183 | { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, |
| 184 | { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 185 | |
| 186 | { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, |
| 187 | { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
| 188 | |
Jens Arnold | 36a69c7 | 2007-10-02 17:57:01 +0000 | [diff] [blame] | 189 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, |
Marianne Arnold | a04972a | 2007-09-21 17:49:43 +0000 | [diff] [blame] | 190 | |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 191 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), |
| 192 | }; /* button_context_settings_right_is_inc */ |
| 193 | |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 194 | static const struct button_mapping button_context_pitchscreen[] = { |
| 195 | { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, |
| 196 | { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
Marianne Arnold | a04972a | 2007-09-21 17:49:43 +0000 | [diff] [blame] | 197 | |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 198 | { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, |
| 199 | { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 200 | |
| 201 | { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE }, |
| 202 | { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, |
| 203 | |
| 204 | { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, |
| 205 | { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, |
| 206 | |
| 207 | { ACTION_PS_RESET, BUTTON_SELECT, BUTTON_NONE }, |
| 208 | { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE }, |
| 209 | |
| 210 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), |
| 211 | }; /* button_context_pitchscreen */ |
| 212 | |
| 213 | /** Recording Screen **/ |
| 214 | #ifdef HAVE_RECORDING |
| 215 | static const struct button_mapping button_context_recscreen[] = { |
Marianne Arnold | bcdb321 | 2007-10-10 22:49:39 +0000 | [diff] [blame] | 216 | { ACTION_STD_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, |
| 217 | { ACTION_REC_PAUSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, |
| 218 | { ACTION_STD_CANCEL, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, |
| 219 | { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC }, |
| 220 | |
| 221 | { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, |
| 222 | { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 223 | { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, |
| 224 | { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 225 | |
| 226 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) |
| 227 | }; /* button_context_recscreen */ |
| 228 | #endif |
| 229 | |
| 230 | /** FM Radio Screen **/ |
| 231 | #if CONFIG_TUNER |
| 232 | static const struct button_mapping button_context_radio[] = { |
Marianne Arnold | 4b259e9 | 2007-10-22 20:37:53 +0000 | [diff] [blame] | 233 | { ACTION_NONE, BUTTON_UP, BUTTON_NONE }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 234 | { ACTION_FM_MENU, BUTTON_DOWN, BUTTON_NONE }, |
| 235 | { ACTION_FM_PRESET, BUTTON_SELECT, BUTTON_NONE }, |
| 236 | { ACTION_FM_STOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, |
| 237 | { ACTION_FM_MODE, BUTTON_REC, BUTTON_NONE }, |
Marianne Arnold | bcdb321 | 2007-10-10 22:49:39 +0000 | [diff] [blame] | 238 | { ACTION_FM_EXIT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 239 | { ACTION_FM_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP }, |
Marianne Arnold | af97e93 | 2007-10-02 21:04:10 +0000 | [diff] [blame] | 240 | { ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE }, |
| 241 | { ACTION_SETTINGS_INCREPEAT,BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, |
| 242 | { ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE }, |
| 243 | { ACTION_SETTINGS_DECREPEAT,BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 244 | |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 245 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) |
| 246 | }; /* button_context_radio */ |
| 247 | #endif |
| 248 | |
| 249 | static const struct button_mapping button_context_keyboard[] = { |
| 250 | { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, |
| 251 | { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 252 | { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, |
| 253 | { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
| 254 | |
Marianne Arnold | 12ddb8e | 2007-09-20 10:49:48 +0000 | [diff] [blame] | 255 | { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_NONE }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 256 | { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT,BUTTON_NONE }, |
Marianne Arnold | 12ddb8e | 2007-09-20 10:49:48 +0000 | [diff] [blame] | 257 | { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 258 | { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE }, |
| 259 | |
| 260 | { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, |
| 261 | { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 262 | { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, |
| 263 | { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
| 264 | |
| 265 | { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_DOWN, BUTTON_NONE }, |
| 266 | { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_DOWN|BUTTON_REPEAT,BUTTON_NONE }, |
| 267 | |
| 268 | { ACTION_KBD_PAGE_FLIP, BUTTON_REC|BUTTON_SELECT, BUTTON_REC }, |
| 269 | |
| 270 | { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, |
Marianne Arnold | 12ddb8e | 2007-09-20 10:49:48 +0000 | [diff] [blame] | 271 | { ACTION_KBD_DONE, BUTTON_VOL_UP, BUTTON_NONE }, |
| 272 | { ACTION_KBD_DONE, BUTTON_VOL_DOWN, BUTTON_NONE }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 273 | { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE }, |
| 274 | |
| 275 | LAST_ITEM_IN_LIST |
| 276 | }; /* button_context_keyboard */ |
| 277 | |
| 278 | static const struct button_mapping button_context_bmark[] = { |
Alessio Lenzi | 4de5b07 | 2007-11-12 22:43:06 +0000 | [diff] [blame] | 279 | { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE }, |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 280 | |
| 281 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), |
| 282 | }; /* button_context_bmark */ |
| 283 | |
| 284 | /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ |
| 285 | const struct button_mapping* get_context_mapping(int context) |
| 286 | { |
| 287 | switch (context) |
| 288 | { |
| 289 | case CONTEXT_STD: |
| 290 | return button_context_standard; |
| 291 | |
| 292 | case CONTEXT_WPS: |
| 293 | return button_context_wps; |
| 294 | |
| 295 | case CONTEXT_LIST: |
| 296 | return button_context_list; |
| 297 | case CONTEXT_TREE: |
| 298 | case CONTEXT_MAINMENU: |
| 299 | if (global_settings.hold_lr_for_scroll_in_list) |
| 300 | return button_context_listtree_scroll_without_combo; |
| 301 | else |
| 302 | return button_context_listtree_scroll_with_combo; |
| 303 | case CONTEXT_CUSTOM|CONTEXT_TREE: |
| 304 | return button_context_tree; |
| 305 | |
| 306 | case CONTEXT_SETTINGS: |
Marianne Arnold | a04972a | 2007-09-21 17:49:43 +0000 | [diff] [blame] | 307 | case CONTEXT_SETTINGS_TIME: |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 308 | return button_context_settings; |
| 309 | case CONTEXT_CUSTOM|CONTEXT_SETTINGS: |
| 310 | case CONTEXT_SETTINGS_COLOURCHOOSER: |
| 311 | case CONTEXT_SETTINGS_EQ: |
Jonathan Gordon | ff469ab | 2008-05-28 10:55:39 +0000 | [diff] [blame] | 312 | case CONTEXT_SETTINGS_RECTRIGGER: |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 313 | return button_context_settings_right_is_inc; |
| 314 | |
Mark Arigo | dbc6b4e | 2007-09-06 03:28:58 +0000 | [diff] [blame] | 315 | case CONTEXT_YESNOSCREEN: |
| 316 | return button_context_yesno; |
| 317 | #if CONFIG_TUNER |
| 318 | case CONTEXT_FM: |
| 319 | return button_context_radio; |
| 320 | #endif |
| 321 | case CONTEXT_BOOKMARKSCREEN: |
| 322 | return button_context_bmark; |
| 323 | case CONTEXT_QUICKSCREEN: |
| 324 | return button_context_quickscreen; |
| 325 | case CONTEXT_PITCHSCREEN: |
| 326 | return button_context_pitchscreen; |
| 327 | #ifdef HAVE_RECORDING |
| 328 | case CONTEXT_RECSCREEN: |
| 329 | return button_context_recscreen; |
| 330 | #endif |
| 331 | case CONTEXT_KEYBOARD: |
| 332 | return button_context_keyboard; |
| 333 | |
| 334 | default: |
| 335 | return button_context_standard; |
| 336 | } |
| 337 | return button_context_standard; |
| 338 | } |