From 08fb988e87b2d41830b390bae94810c4937675b5 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 23 May 2009 14:42:54 +0000 Subject: 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 --- apps/keymaps/keymap-c100.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'apps/keymaps/keymap-c100.c') diff --git a/apps/keymaps/keymap-c100.c b/apps/keymaps/keymap-c100.c index 70cb17ae1a..087be8665f 100644 --- a/apps/keymaps/keymap-c100.c +++ b/apps/keymaps/keymap-c100.c @@ -269,6 +269,19 @@ static const struct button_mapping button_context_bmark[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), }; /* button_context_bmark */ +#ifdef HAVE_USBSTACK +static const struct button_mapping button_context_usb_hid[] = { + { ACTION_USB_HID_PLAY, BUTTON_VOLUP, BUTTON_NONE }, + { ACTION_USB_HID_STOP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_SKIPPREV, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_USB_HID_SKIPNEXT, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_USB_HID_MUTE, BUTTON_VOLDOWN, BUTTON_NONE }, + { ACTION_USB_HID_MENU, BUTTON_MENU, BUTTON_NONE }, + + LAST_ITEM_IN_LIST +}; /* button_context_usb_hid */ +#endif + /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ const struct button_mapping* get_context_mapping(int context) { @@ -317,7 +330,10 @@ const struct button_mapping* get_context_mapping(int context) #endif case CONTEXT_KEYBOARD: return button_context_keyboard; - +#ifdef HAVE_USBSTACK + case CONTEXT_USB_HID: + return button_context_usb_hid; +#endif default: return button_context_standard; } -- cgit v1.2.3