forked from len0rd/rockbox
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
This commit is contained in:
parent
c61a75173b
commit
08fb988e87
14 changed files with 422 additions and 11 deletions
|
@ -281,6 +281,23 @@ 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_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MUTE, BUTTON_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_POWER, 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)
|
||||
{
|
||||
|
@ -330,7 +347,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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue