gitscraper: support Python3.
[maemo-rb.git] / apps / keymaps / keymap-rk27xx-generic.c
bloba709df6156513fca2c2fb7b8231b27f65f48ee10
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2011 Marcin Bukat
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 rk27xx reference design target */
24 #include "config.h"
25 #include "action.h"
26 #include "button.h"
28 /*
29 * The format of the list is as follows
30 * { Action Code, Button code, Prereq button code }
31 * if there's no need to check the previous button's value, use BUTTON_NONE
32 * Insert LAST_ITEM_IN_LIST at the end of each mapping
34 static const struct button_mapping button_context_standard[] = {
35 { ACTION_STD_PREV, BUTTON_REW, BUTTON_NONE },
36 { ACTION_STD_PREVREPEAT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE },
37 { ACTION_STD_NEXT, BUTTON_FF, BUTTON_NONE },
38 { ACTION_STD_NEXTREPEAT, BUTTON_FF|BUTTON_REPEAT, BUTTON_NONE },
39 { ACTION_STD_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
40 { ACTION_STD_CANCEL, BUTTON_VOL, BUTTON_NONE },
41 { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
42 { ACTION_STD_MENU, BUTTON_M, BUTTON_NONE },
44 LAST_ITEM_IN_LIST
45 }; /* button_context_standard */
47 static const struct button_mapping button_context_wps[] = {
48 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
49 { ACTION_WPS_SKIPNEXT, BUTTON_FF|BUTTON_REL, BUTTON_FF },
50 { ACTION_WPS_SKIPPREV, BUTTON_REW|BUTTON_REL, BUTTON_REW },
51 { ACTION_WPS_SEEKBACK, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE },
52 { ACTION_WPS_SEEKFWD, BUTTON_FF|BUTTON_REPEAT, BUTTON_NONE },
53 { ACTION_WPS_STOPSEEK, BUTTON_REW|BUTTON_REL, BUTTON_REW|BUTTON_REPEAT },
54 { ACTION_WPS_STOPSEEK, BUTTON_FF|BUTTON_REL, BUTTON_FF|BUTTON_REPEAT },
55 { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
56 { ACTION_WPS_VOLDOWN, BUTTON_REW|BUTTON_VOL, BUTTON_NONE },
57 { ACTION_WPS_VOLDOWN, BUTTON_REW|BUTTON_VOL|BUTTON_REPEAT, BUTTON_NONE },
58 { ACTION_WPS_VOLUP, BUTTON_FF|BUTTON_VOL, BUTTON_NONE },
59 { ACTION_WPS_VOLUP, BUTTON_FF|BUTTON_VOL|BUTTON_REPEAT, BUTTON_NONE },
61 { ACTION_WPS_BROWSE, BUTTON_VOL|BUTTON_REL, BUTTON_VOL },
62 { ACTION_WPS_MENU, BUTTON_M|BUTTON_REL, BUTTON_M },
63 { ACTION_WPS_CONTEXT, BUTTON_M|BUTTON_REPEAT, BUTTON_M },
64 { ACTION_STD_KEYLOCK, BUTTON_M|BUTTON_VOL, BUTTON_NONE },
66 LAST_ITEM_IN_LIST
67 }; /* button_context_wps */
71 /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
72 const struct button_mapping* get_context_mapping(int context)
74 switch (context)
76 case CONTEXT_STD:
77 return button_context_standard;
78 case CONTEXT_WPS:
79 return button_context_wps;
81 case CONTEXT_TREE:
82 case CONTEXT_LIST:
83 case CONTEXT_MAINMENU:
85 case CONTEXT_SETTINGS:
86 case CONTEXT_SETTINGS|CONTEXT_REMOTE:
87 default:
88 return button_context_standard;
90 return button_context_standard;