diff options
Diffstat (limited to 'apps/keymaps/keymap-newtarget.c')
-rw-r--r-- | apps/keymaps/keymap-newtarget.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/apps/keymaps/keymap-newtarget.c b/apps/keymaps/keymap-newtarget.c new file mode 100644 index 0000000000..3cd828c0b4 --- /dev/null +++ b/apps/keymaps/keymap-newtarget.c | |||
@@ -0,0 +1,77 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 200 | ||
10 | * | ||
11 | * All files in this archive are subject to the GNU General Public License. | ||
12 | * See the file COPYING in the source tree root for full license agreement. | ||
13 | * | ||
14 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
15 | * KIND, either express or implied. | ||
16 | * | ||
17 | ****************************************************************************/ | ||
18 | |||
19 | /* Button Code Definitions for <new> target */ | ||
20 | |||
21 | #include "config.h" | ||
22 | #include "action.h" | ||
23 | #include "button.h" | ||
24 | |||
25 | #define LAST_ITEM_IN_LIST { ACTION_NONE,BUTTON_NONE,BUTTON_NONE } | ||
26 | /* {Action Code, Button code, Prereq button code } */ | ||
27 | |||
28 | /** | ||
29 | This file is where all button mappings are defined. | ||
30 | In ../action.h there is an enum with all the used ACTION_ codes. | ||
31 | Ideally All the ACTION_STD_* and ACTION_WPS_* codes should be defined somehwere in this file. | ||
32 | |||
33 | Remeber to make a copy of this file and rename it to keymap-<targetname>.c and add it to apps/SOURCES | ||
34 | |||
35 | Good luck and thanks for porting a new target! :D | ||
36 | |||
37 | **/ | ||
38 | |||
39 | /* | ||
40 | * The format of the list is as follows | ||
41 | * { Action Code, Button code, Prereq button code } | ||
42 | * if there's no need to check the previous button's value, use BUTTON_NONE | ||
43 | * Insert LAST_ITEM_IN_LIST at the end of each mapping | ||
44 | */ | ||
45 | struct button_mapping button_context_standard[] = { | ||
46 | |||
47 | LAST_ITEM_IN_LIST | ||
48 | }; /* button_context_standard */ | ||
49 | |||
50 | struct button_mapping button_context_wps[] = { | ||
51 | |||
52 | LAST_ITEM_IN_LIST | ||
53 | }; /* button_context_wps */ | ||
54 | |||
55 | |||
56 | |||
57 | /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ | ||
58 | struct button_mapping* get_context_mapping(int context) | ||
59 | { | ||
60 | switch (context) | ||
61 | { | ||
62 | case CONTEXT_STD: | ||
63 | return button_context_standard; | ||
64 | case CONTEXT_WPS: | ||
65 | return button_context_wps; | ||
66 | |||
67 | case CONTEXT_TREE: | ||
68 | case CONTEXT_LIST: | ||
69 | case CONTEXT_MAINMENU: | ||
70 | |||
71 | case CONTEXT_SETTINGS: | ||
72 | case CONTEXT_SETTINGS|CONTEXT_REMOTE: | ||
73 | default: | ||
74 | return button_context_standard; | ||
75 | } | ||
76 | return button_context_standard; | ||
77 | } | ||