diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2009-05-23 14:42:54 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2009-05-23 14:42:54 +0000 |
commit | 08fb988e87b2d41830b390bae94810c4937675b5 (patch) | |
tree | 8467923d53d211afdf8e9fc94e3e9e39f877ada7 /apps/keymaps/keymap-touchscreen.c | |
parent | c61a75173b2e81ea3ae3aa1d3cdf84d15e4304c3 (diff) | |
download | rockbox-08fb988e87b2d41830b390bae94810c4937675b5.tar.gz rockbox-08fb988e87b2d41830b390bae94810c4937675b5.zip |
Add HID keymap handling in usb screen. This allows to use the DAP as a keypad to control the PC. The current keymaps are audio-oriented (play/pause/volume/...) (FS#10218 by Tomer Shalev)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21054 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/keymaps/keymap-touchscreen.c')
-rw-r--r-- | apps/keymaps/keymap-touchscreen.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/keymaps/keymap-touchscreen.c b/apps/keymaps/keymap-touchscreen.c index ce5d01c9dc..70009794a5 100644 --- a/apps/keymaps/keymap-touchscreen.c +++ b/apps/keymaps/keymap-touchscreen.c | |||
@@ -245,6 +245,18 @@ static const struct button_mapping button_context_radio[] = { | |||
245 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_FM) | 245 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_FM) |
246 | }; /* button_context_radio */ | 246 | }; /* button_context_radio */ |
247 | 247 | ||
248 | #ifdef HAVE_USBSTACK | ||
249 | static const struct button_mapping button_context_usb_hid[] = { | ||
250 | { ACTION_USB_HID_PLAY, BUTTON_TOPRIGHT, BUTTON_NONE }, | ||
251 | { ACTION_USB_HID_SKIPPREV, BUTTON_MIDLEFT, BUTTON_NONE }, | ||
252 | { ACTION_USB_HID_SKIPNEXT, BUTTON_MIDRIGHT, BUTTON_NONE }, | ||
253 | { ACTION_USB_HID_MUTE, BUTTON_CENTER, BUTTON_NONE }, | ||
254 | { ACTION_USB_HID_MENU, BUTTON_TOPLEFT, BUTTON_NONE }, | ||
255 | |||
256 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_USB_HID) | ||
257 | }; /* button_context_usb_hid */ | ||
258 | #endif | ||
259 | |||
248 | const struct button_mapping* get_context_mapping(int context) | 260 | const struct button_mapping* get_context_mapping(int context) |
249 | { | 261 | { |
250 | if (context & CONTEXT_CUSTOM2 | 262 | if (context & CONTEXT_CUSTOM2 |
@@ -297,6 +309,10 @@ const struct button_mapping* get_context_mapping(int context) | |||
297 | return button_context_pitchscreen; | 309 | return button_context_pitchscreen; |
298 | case CONTEXT_KEYBOARD: | 310 | case CONTEXT_KEYBOARD: |
299 | return button_context_keyboard; | 311 | return button_context_keyboard; |
312 | #ifdef HAVE_USBSTACK | ||
313 | case CONTEXT_USB_HID: | ||
314 | return button_context_usb_hid; | ||
315 | #endif | ||
300 | } | 316 | } |
301 | return button_context_standard; | 317 | return button_context_standard; |
302 | } | 318 | } |