diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-04-15 10:35:11 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-04-15 10:35:11 +0000 |
commit | 5b5a626bb6ba54ccdcd90741cea5f9cbd0f79553 (patch) | |
tree | 0bf60b83aad534757330162ad4f683f142955ccb /apps/keymaps/keymap-cowond2.c | |
parent | 50851794a6bdd585ce70ecb430b1f798fb90936b (diff) | |
download | rockbox-5b5a626bb6ba54ccdcd90741cea5f9cbd0f79553.tar.gz rockbox-5b5a626bb6ba54ccdcd90741cea5f9cbd0f79553.zip |
Setup the touchpads to have two modes - stylus and button - and set them in button mode by default.
in button mode the touchpad is split into a 3x3 grid for 9 seperate buttons which can be used by the action system like real buttons.
Unify the keymap file for the touchpads in button mode. the target keymap file only needs to worry about real buttons.
(As these ports mature each screen will need to be fixed seperatly to be able to use stylus mode (the lists can already but don't change mode just yet.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17114 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/keymaps/keymap-cowond2.c')
-rw-r--r-- | apps/keymaps/keymap-cowond2.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/apps/keymaps/keymap-cowond2.c b/apps/keymaps/keymap-cowond2.c index ff4fdc5417..59ca7cb123 100644 --- a/apps/keymaps/keymap-cowond2.c +++ b/apps/keymaps/keymap-cowond2.c | |||
@@ -37,48 +37,27 @@ | |||
37 | */ | 37 | */ |
38 | 38 | ||
39 | static const struct button_mapping button_context_standard[] = { | 39 | static const struct button_mapping button_context_standard[] = { |
40 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, | ||
41 | { ACTION_STD_PREV, BUTTON_MINUS, BUTTON_NONE }, | 40 | { ACTION_STD_PREV, BUTTON_MINUS, BUTTON_NONE }, |
42 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
43 | { ACTION_STD_PREVREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, | 41 | { ACTION_STD_PREVREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, |
44 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
45 | { ACTION_STD_NEXT, BUTTON_PLUS, BUTTON_NONE }, | 42 | { ACTION_STD_NEXT, BUTTON_PLUS, BUTTON_NONE }, |
46 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
47 | { ACTION_STD_NEXTREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, | 43 | { ACTION_STD_NEXTREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, |
48 | 44 | ||
49 | { ACTION_STD_OK, BUTTON_MENU|BUTTON_REL, BUTTON_NONE }, | 45 | { ACTION_STD_OK, BUTTON_MENU|BUTTON_REL, BUTTON_NONE }, |
50 | { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
51 | |||
52 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | 46 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, |
53 | // { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | 47 | // { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, |
54 | { ACTION_STD_CONTEXT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, | 48 | { ACTION_STD_CONTEXT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, |
55 | { ACTION_STD_CONTEXT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
56 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | 49 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, |
57 | { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, | ||
58 | { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
59 | LAST_ITEM_IN_LIST | 50 | LAST_ITEM_IN_LIST |
60 | }; /* button_context_standard */ | 51 | }; /* button_context_standard */ |
61 | 52 | ||
62 | 53 | ||
63 | static const struct button_mapping button_context_wps[] = { | 54 | static const struct button_mapping button_context_wps[] = { |
64 | { ACTION_WPS_PLAY, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
65 | { ACTION_WPS_STOP, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
66 | { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
67 | { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
68 | { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, | ||
69 | { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
70 | { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
71 | { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, | ||
72 | 55 | ||
73 | { ACTION_WPS_VOLDOWN, BUTTON_MINUS, BUTTON_NONE }, | 56 | { ACTION_WPS_VOLDOWN, BUTTON_MINUS, BUTTON_NONE }, |
74 | { ACTION_WPS_VOLDOWN, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, | 57 | { ACTION_WPS_VOLDOWN, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, |
75 | { ACTION_WPS_VOLUP, BUTTON_PLUS, BUTTON_NONE }, | 58 | { ACTION_WPS_VOLUP, BUTTON_PLUS, BUTTON_NONE }, |
76 | { ACTION_WPS_VOLUP, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, | 59 | { ACTION_WPS_VOLUP, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, |
77 | |||
78 | { ACTION_WPS_BROWSE, BUTTON_UP|BUTTON_REL, BUTTON_UP }, | ||
79 | { ACTION_WPS_CONTEXT, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, | ||
80 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | 60 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, |
81 | { ACTION_WPS_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN }, | ||
82 | LAST_ITEM_IN_LIST | 61 | LAST_ITEM_IN_LIST |
83 | }; /* button_context_wps */ | 62 | }; /* button_context_wps */ |
84 | 63 | ||
@@ -99,13 +78,9 @@ static const struct button_mapping button_context_listtree_scroll_without_combo[ | |||
99 | }; | 78 | }; |
100 | 79 | ||
101 | static const struct button_mapping button_context_settings[] = { | 80 | static const struct button_mapping button_context_settings[] = { |
102 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, | ||
103 | { ACTION_SETTINGS_INC, BUTTON_PLUS, BUTTON_NONE }, | 81 | { ACTION_SETTINGS_INC, BUTTON_PLUS, BUTTON_NONE }, |
104 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
105 | { ACTION_SETTINGS_INCREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, | 82 | { ACTION_SETTINGS_INCREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, |
106 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, | ||
107 | { ACTION_SETTINGS_DEC, BUTTON_MINUS, BUTTON_NONE }, | 83 | { ACTION_SETTINGS_DEC, BUTTON_MINUS, BUTTON_NONE }, |
108 | { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
109 | { ACTION_SETTINGS_DECREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, | 84 | { ACTION_SETTINGS_DECREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, |
110 | { ACTION_STD_OK, BUTTON_MENU, BUTTON_NONE }, | 85 | { ACTION_STD_OK, BUTTON_MENU, BUTTON_NONE }, |
111 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | 86 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, |
@@ -154,10 +129,9 @@ static const struct button_mapping button_context_keyboard[] = { | |||
154 | //LAST_ITEM_IN_LIST | 129 | //LAST_ITEM_IN_LIST |
155 | }; /* button_context_keyboard */ | 130 | }; /* button_context_keyboard */ |
156 | 131 | ||
157 | extern int current_tick; | 132 | const struct button_mapping* target_get_context_mapping(int context) |
158 | const struct button_mapping* get_context_mapping(int context) | ||
159 | { | 133 | { |
160 | switch (context&(~CONTEXT_REMOTE)) | 134 | switch (context) |
161 | { | 135 | { |
162 | case CONTEXT_STD: | 136 | case CONTEXT_STD: |
163 | return button_context_standard; | 137 | return button_context_standard; |