* Commit a modified FS#10354 (thanks to Davide Quarta) - add support the VX747+ in...
[kugel-rb.git] / apps / keymaps / keymap-ondavx777.c
blob99f509b18fcc82e0376743fa24c297b851a51a7e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
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 */
25 #include <stdio.h>
26 #include <string.h>
27 #include <stdlib.h>
29 #include "config.h"
30 #include "action.h"
31 #include "button.h"
32 #include "settings.h"
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[] = {
42 LAST_ITEM_IN_LIST
43 }; /* button_context_standard */
46 static const struct button_mapping button_context_wps[] = {
47 LAST_ITEM_IN_LIST
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 */
113 #ifdef HAVE_USBSTACK
114 static const struct button_mapping button_context_usb_hid[] = {
115 LAST_ITEM_IN_LIST
116 }; /* button_context_usb_hid */
117 #endif
119 const struct button_mapping* target_get_context_mapping(int context)
121 switch (context)
123 case CONTEXT_STD:
124 return button_context_standard;
125 case CONTEXT_WPS:
126 return button_context_wps;
128 case CONTEXT_LIST:
129 return button_context_list;
130 case CONTEXT_MAINMENU:
131 case CONTEXT_TREE:
132 if (global_settings.hold_lr_for_scroll_in_list)
133 return button_context_listtree_scroll_without_combo;
134 else
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;
155 case CONTEXT_FM:
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;
165 #ifdef HAVE_USBSTACK
166 case CONTEXT_USB_HID:
167 return button_context_usb_hid;
168 #endif
170 return button_context_standard;