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-touchscreen.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'apps/keymaps/keymap-touchscreen.c') 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[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_FM) }; /* button_context_radio */ +#ifdef HAVE_USBSTACK +static const struct button_mapping button_context_usb_hid[] = { + { ACTION_USB_HID_PLAY, BUTTON_TOPRIGHT, BUTTON_NONE }, + { ACTION_USB_HID_SKIPPREV, BUTTON_MIDLEFT, BUTTON_NONE }, + { ACTION_USB_HID_SKIPNEXT, BUTTON_MIDRIGHT, BUTTON_NONE }, + { ACTION_USB_HID_MUTE, BUTTON_CENTER, BUTTON_NONE }, + { ACTION_USB_HID_MENU, BUTTON_TOPLEFT, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_USB_HID) +}; /* button_context_usb_hid */ +#endif + const struct button_mapping* get_context_mapping(int context) { if (context & CONTEXT_CUSTOM2 @@ -297,6 +309,10 @@ const struct button_mapping* get_context_mapping(int context) return button_context_pitchscreen; case CONTEXT_KEYBOARD: return button_context_keyboard; +#ifdef HAVE_USBSTACK + case CONTEXT_USB_HID: + return button_context_usb_hid; +#endif } return button_context_standard; } -- cgit v1.2.3