blob: f9af353e67abbe599319d4c334d2b26a29cd6bdc [file] [log] [blame]
Linus Nielsen Feltzing224c0a12006-08-15 12:27:07 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 200
10 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000011 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
Linus Nielsen Feltzing224c0a12006-08-15 12:27:07 +000015 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20
21/* Button Code Definitions for <new> target */
22
23#include "config.h"
24#include "action.h"
25#include "button.h"
26
27#define LAST_ITEM_IN_LIST { ACTION_NONE,BUTTON_NONE,BUTTON_NONE }
28/* {Action Code, Button code, Prereq button code } */
29
30/**
31 This file is where all button mappings are defined.
32 In ../action.h there is an enum with all the used ACTION_ codes.
33 Ideally All the ACTION_STD_* and ACTION_WPS_* codes should be defined somehwere in this file.
34
35 Remeber to make a copy of this file and rename it to keymap-<targetname>.c and add it to apps/SOURCES
36
37 Good luck and thanks for porting a new target! :D
38
39**/
40
41/*
42 * The format of the list is as follows
43 * { Action Code, Button code, Prereq button code }
44 * if there's no need to check the previous button's value, use BUTTON_NONE
45 * Insert LAST_ITEM_IN_LIST at the end of each mapping
46 */
Jens Arnolda0f31132006-12-12 07:55:17 +000047static const struct button_mapping button_context_standard[] = {
Linus Nielsen Feltzing224c0a12006-08-15 12:27:07 +000048
49 LAST_ITEM_IN_LIST
50}; /* button_context_standard */
51
Jens Arnolda0f31132006-12-12 07:55:17 +000052static const struct button_mapping button_context_wps[] = {
Linus Nielsen Feltzing224c0a12006-08-15 12:27:07 +000053
54 LAST_ITEM_IN_LIST
55}; /* button_context_wps */
56
57
58
59/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
Jens Arnold1fdb5bf2006-08-16 00:32:45 +000060const struct button_mapping* get_context_mapping(int context)
Linus Nielsen Feltzing224c0a12006-08-15 12:27:07 +000061{
62 switch (context)
63 {
64 case CONTEXT_STD:
65 return button_context_standard;
66 case CONTEXT_WPS:
67 return button_context_wps;
68
69 case CONTEXT_TREE:
70 case CONTEXT_LIST:
71 case CONTEXT_MAINMENU:
72
73 case CONTEXT_SETTINGS:
74 case CONTEXT_SETTINGS|CONTEXT_REMOTE:
75 default:
76 return button_context_standard;
77 }
78 return button_context_standard;
79}