1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2009 by Maurus Cuelenaere
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 /* Button Code Definitions for the Onda VX747 target */
23 /* NB: Up/Down/Left/Right are not physical buttons - touchscreen emulation */
35 * The format of the list is as follows
36 * { Action Code, Button code, Prereq button code }
37 * if there's no need to check the previous button's value, use BUTTON_NONE
38 * Insert LAST_ITEM_IN_LIST at the end of each mapping
41 static const struct button_mapping button_context_standard
[] = {
43 }; /* button_context_standard */
46 static const struct button_mapping button_context_wps
[] = {
48 }; /* button_context_wps */
50 static const struct button_mapping button_context_list
[] = {
51 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
)
52 }; /* button_context_list */
54 static const struct button_mapping button_context_tree
[] = {
55 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST
)
56 }; /* button_context_tree */
58 static const struct button_mapping button_context_listtree_scroll_with_combo
[] = {
59 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM
|CONTEXT_TREE
),
62 static const struct button_mapping button_context_listtree_scroll_without_combo
[] = {
63 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM
|CONTEXT_TREE
),
66 static const struct button_mapping button_context_settings
[] = {
67 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
)
68 }; /* button_context_settings */
70 static const struct button_mapping button_context_settings_right_is_inc
[] = {
72 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
)
73 }; /* button_context_settingsgraphical */
75 static const struct button_mapping button_context_yesno
[] = {
76 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
)
77 }; /* button_context_settings_yesno */
79 static const struct button_mapping button_context_colorchooser
[] = {
80 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM
|CONTEXT_SETTINGS
),
81 }; /* button_context_colorchooser */
83 static const struct button_mapping button_context_eq
[] = {
84 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM
|CONTEXT_SETTINGS
),
85 }; /* button_context_eq */
87 /** Bookmark Screen **/
88 static const struct button_mapping button_context_bmark
[] = {
89 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST
),
90 }; /* button_context_bmark */
92 static const struct button_mapping button_context_time
[] = {
93 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS
),
94 }; /* button_context_time */
96 static const struct button_mapping button_context_quickscreen
[] = {
98 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
)
99 }; /* button_context_quickscreen */
101 static const struct button_mapping button_context_pitchscreen
[] = {
102 }; /* button_context_pitchcreen */
104 /** FM Radio Screen **/
105 static const struct button_mapping button_context_radio
[] = {
106 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS
)
107 }; /* button_context_radio */
109 static const struct button_mapping button_context_keyboard
[] = {
110 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
)
111 }; /* button_context_keyboard */
114 static const struct button_mapping button_context_usb_hid
[] = {
116 }; /* button_context_usb_hid */
119 const struct button_mapping
* target_get_context_mapping(int context
)
124 return button_context_standard
;
126 return button_context_wps
;
129 return button_context_list
;
130 case CONTEXT_MAINMENU
:
132 if (global_settings
.hold_lr_for_scroll_in_list
)
133 return button_context_listtree_scroll_without_combo
;
135 return button_context_listtree_scroll_with_combo
;
136 case CONTEXT_CUSTOM
|CONTEXT_TREE
:
137 return button_context_tree
;
139 case CONTEXT_SETTINGS
:
140 return button_context_settings
;
141 case CONTEXT_CUSTOM
|CONTEXT_SETTINGS
:
142 case CONTEXT_SETTINGS_RECTRIGGER
:
143 return button_context_settings_right_is_inc
;
145 case CONTEXT_SETTINGS_COLOURCHOOSER
:
146 return button_context_colorchooser
;
147 case CONTEXT_SETTINGS_EQ
:
148 return button_context_eq
;
150 case CONTEXT_SETTINGS_TIME
:
151 return button_context_time
;
153 case CONTEXT_YESNOSCREEN
:
154 return button_context_yesno
;
156 return button_context_radio
;
157 case CONTEXT_BOOKMARKSCREEN
:
158 return button_context_bmark
;
159 case CONTEXT_QUICKSCREEN
:
160 return button_context_quickscreen
;
161 case CONTEXT_PITCHSCREEN
:
162 return button_context_pitchscreen
;
163 case CONTEXT_KEYBOARD
:
164 return button_context_keyboard
;
166 case CONTEXT_USB_HID
:
167 return button_context_usb_hid
;
170 return button_context_standard
;