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-hdd1630.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-hdd1630.c')
-rw-r--r-- | apps/keymaps/keymap-hdd1630.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/keymaps/keymap-hdd1630.c b/apps/keymaps/keymap-hdd1630.c index 6b38983d08..deb77307b8 100644 --- a/apps/keymaps/keymap-hdd1630.c +++ b/apps/keymaps/keymap-hdd1630.c | |||
@@ -282,6 +282,27 @@ static const struct button_mapping button_context_radio[] = { | |||
282 | }; | 282 | }; |
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | #ifdef HAVE_USBSTACK | ||
286 | static const struct button_mapping button_context_usb_hid[] = { | ||
287 | { ACTION_USB_HID_PLAY, BUTTON_VIEW, BUTTON_NONE }, | ||
288 | { ACTION_USB_HID_STOP, BUTTON_POWER, BUTTON_NONE }, | ||
289 | { ACTION_USB_HID_SKIPPREV, BUTTON_LEFT, BUTTON_NONE }, | ||
290 | { ACTION_USB_HID_SKIPNEXT, BUTTON_RIGHT, BUTTON_NONE }, | ||
291 | { ACTION_USB_HID_VOLUP, BUTTON_UP, BUTTON_NONE }, | ||
292 | { ACTION_USB_HID_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
293 | { ACTION_USB_HID_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
294 | { ACTION_USB_HID_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
295 | { ACTION_USB_HID_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
296 | { ACTION_USB_HID_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
297 | { ACTION_USB_HID_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
298 | { ACTION_USB_HID_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
299 | { ACTION_USB_HID_MUTE, BUTTON_SELECT, BUTTON_NONE }, | ||
300 | { ACTION_USB_HID_MENU, BUTTON_MENU, BUTTON_NONE }, | ||
301 | |||
302 | LAST_ITEM_IN_LIST | ||
303 | }; /* button_context_usb_hid */ | ||
304 | #endif | ||
305 | |||
285 | const struct button_mapping* get_context_mapping(int context) | 306 | const struct button_mapping* get_context_mapping(int context) |
286 | { | 307 | { |
287 | switch (context) | 308 | switch (context) |
@@ -329,6 +350,10 @@ const struct button_mapping* get_context_mapping(int context) | |||
329 | case CONTEXT_FM: | 350 | case CONTEXT_FM: |
330 | return button_context_radio; | 351 | return button_context_radio; |
331 | #endif | 352 | #endif |
353 | #ifdef HAVE_USBSTACK | ||
354 | case CONTEXT_USB_HID: | ||
355 | return button_context_usb_hid; | ||
356 | #endif | ||
332 | } | 357 | } |
333 | return button_context_standard; | 358 | return button_context_standard; |
334 | } | 359 | } |