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
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -265,6 +265,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_POWER, 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_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_DOWN, 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)
|
||||
{
|
||||
|
|
@ -310,7 +327,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
return button_context_recscreen;
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,6 +271,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_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_SCROLL_FWD, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_SCROLL_BACK, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MUTE, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_DOWN, 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)
|
||||
{
|
||||
|
|
@ -318,7 +335,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
return button_context_recscreen;
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -464,6 +464,42 @@ static const struct button_mapping remote_button_context_right_is_inc[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* remote_button_context_right_is_inc */
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
static const struct button_mapping button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_UP|BUTTON_REPEAT, 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_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_DOWN|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_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_MENU, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
static const struct button_mapping remote_button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_RC_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_RC_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_RC_REW, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RC_FF, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MUTE, BUTTON_RC_DSP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_RC_DSP, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* remote_button_context_usb_hid */
|
||||
#endif
|
||||
|
||||
static const struct button_mapping* get_context_mapping_remote( int context )
|
||||
{
|
||||
context &= ~CONTEXT_REMOTE;
|
||||
|
|
@ -506,6 +542,10 @@ static const struct button_mapping* get_context_mapping_remote( int context )
|
|||
case CONTEXT_FM:
|
||||
return remote_button_context_radio;
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
case CONTEXT_USB_HID:
|
||||
return remote_button_context_usb_hid;
|
||||
#endif
|
||||
default:
|
||||
return remote_button_context_standard;
|
||||
}
|
||||
|
|
@ -573,6 +613,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
case CONTEXT_FM:
|
||||
return button_context_radio;
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#endif
|
||||
default:
|
||||
return button_context_standard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -332,6 +332,61 @@ static const struct button_mapping button_context_radio[] = {
|
|||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static const struct button_mapping remote_button_context_wps[] = {
|
||||
{ ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
|
||||
{ ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT,BUTTON_RC_PLAY },
|
||||
{ ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW},
|
||||
{ ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
|
||||
{ ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
|
||||
{ ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
|
||||
|
||||
{ ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_WPS_PITCHSCREEN, BUTTON_RC_PLAY|BUTTON_LEFT, BUTTON_RC_PLAY },
|
||||
{ ACTION_WPS_ID3SCREEN, BUTTON_RC_PLAY|BUTTON_RIGHT, BUTTON_RC_PLAY },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* remote_button_context_wps */
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
static const struct button_mapping button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_REW, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_FF, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_SCROLL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_POWER, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
static const struct button_mapping remote_button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_RC_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_RC_REW, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RC_FF, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_RC_SCROLL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_RC_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_RC_SCROLL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_RC_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* remote_button_context_usb_hid */
|
||||
#endif
|
||||
|
||||
static const struct button_mapping* get_context_mapping_remote( int context )
|
||||
{
|
||||
context ^= CONTEXT_REMOTE;
|
||||
|
|
@ -361,6 +416,10 @@ static const struct button_mapping* get_context_mapping_remote( int context )
|
|||
return remote_button_context_pitchscreen;
|
||||
case CONTEXT_RECSCREEN:
|
||||
return button_context_recscreen;
|
||||
#ifdef HAVE_USBSTACK
|
||||
case CONTEXT_USB_HID:
|
||||
return remote_button_context_usb_hid;
|
||||
#endif
|
||||
|
||||
default:
|
||||
return remote_button_context_standard;
|
||||
|
|
@ -415,6 +474,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
return button_context_recscreen;
|
||||
case CONTEXT_FM:
|
||||
return button_context_radio;
|
||||
#ifdef HAVE_USBSTACK
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#endif
|
||||
default:
|
||||
return button_context_standard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,6 +282,27 @@ static const struct button_mapping button_context_radio[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
static const struct button_mapping button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_VIEW, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_UP|BUTTON_REPEAT, 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_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_DOWN|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_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_MENU, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
#endif
|
||||
|
||||
const struct button_mapping* get_context_mapping(int context)
|
||||
{
|
||||
switch (context)
|
||||
|
|
@ -328,6 +349,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#if CONFIG_TUNER
|
||||
case CONTEXT_FM:
|
||||
return button_context_radio;
|
||||
#endif
|
||||
#ifdef HAVE_USBSTACK
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#endif
|
||||
}
|
||||
return button_context_standard;
|
||||
|
|
|
|||
|
|
@ -188,6 +188,23 @@ const struct button_mapping button_context_recscreen[] = {
|
|||
}; /* button_context_recscreen */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
static const struct button_mapping button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_PLAY|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_SCROLL_FWD, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_SCROLL_BACK, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MUTE, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_MENU, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
#endif
|
||||
|
||||
#if BUTTON_REMOTE != 0
|
||||
/*****************************************************************************
|
||||
* Remote control mappings
|
||||
|
|
@ -220,6 +237,20 @@ static const struct button_mapping remote_button_context_wps[] = {
|
|||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
};
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
static const struct button_mapping remote_button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_RC_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_RC_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RC_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* remote_button_context_usb_hid */
|
||||
#endif
|
||||
|
||||
static const struct button_mapping* get_context_mapping_remote( int context )
|
||||
{
|
||||
|
|
@ -229,7 +260,10 @@ static const struct button_mapping* get_context_mapping_remote( int context )
|
|||
{
|
||||
case CONTEXT_WPS:
|
||||
return remote_button_context_wps;
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
case CONTEXT_USB_HID:
|
||||
return remote_button_context_usb_hid;
|
||||
#endif
|
||||
default:
|
||||
return remote_button_context_standard;
|
||||
}
|
||||
|
|
@ -281,6 +315,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#ifdef HAVE_RECORDING
|
||||
case CONTEXT_RECSCREEN:
|
||||
return button_context_recscreen;
|
||||
#endif
|
||||
#ifdef HAVE_USBSTACK
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#endif
|
||||
default:
|
||||
return button_context_standard;
|
||||
|
|
|
|||
|
|
@ -313,6 +313,37 @@ static const struct button_mapping remote_button_context_tree[] = {
|
|||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
};
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
static const struct button_mapping button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MUTE, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_MENU, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
static const struct button_mapping remote_button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_RC_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_RC_REW, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RC_FF, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_RC_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_RC_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_RC_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_RC_FAV, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* remote_button_context_usb_hid */
|
||||
#endif
|
||||
|
||||
static const struct button_mapping* get_context_mapping_remote( int context )
|
||||
{
|
||||
context ^= CONTEXT_REMOTE;
|
||||
|
|
@ -324,6 +355,10 @@ static const struct button_mapping* get_context_mapping_remote( int context )
|
|||
case CONTEXT_MAINMENU:
|
||||
case CONTEXT_TREE:
|
||||
return remote_button_context_tree;
|
||||
#ifdef HAVE_USBSTACK
|
||||
case CONTEXT_USB_HID:
|
||||
return remote_button_context_usb_hid;
|
||||
#endif
|
||||
}
|
||||
return remote_button_context_standard;
|
||||
}
|
||||
|
|
@ -374,6 +409,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,6 +152,19 @@ static const struct button_mapping button_context_keyboard[] = {
|
|||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
}; /* button_context_keyboard */
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
static const struct button_mapping button_context_usb_hid[] = {
|
||||
{ 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_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_MENU, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
#endif
|
||||
|
||||
const struct button_mapping* target_get_context_mapping(int context)
|
||||
{
|
||||
switch (context)
|
||||
|
|
@ -196,6 +209,10 @@ const struct button_mapping* target_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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,6 +269,27 @@ static const struct button_mapping button_context_keyboard[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_keyboard */
|
||||
|
||||
#ifdef HAVE_USBSTACK
|
||||
static const struct button_mapping button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_REW, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_FFWD, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLUP, BUTTON_UP|BUTTON_REPEAT, 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_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_VOLDOWN, BUTTON_DOWN|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_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_MENU, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
#endif
|
||||
|
||||
const struct button_mapping* get_context_mapping(int context)
|
||||
{
|
||||
switch (context)
|
||||
|
|
@ -312,6 +333,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue