Add USB HID mouse support for H10
- Protect mouse keymaps with #ifdef HAVE_USB_HID_MOUSE - Add preliminary support for remote mouse mode in iPods, pending P#10623 - Use ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP/DOWN instead of standard INC/DEC git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22940 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ce53dd6523
commit
0c379b4b2e
14 changed files with 404 additions and 263 deletions
|
@ -287,6 +287,8 @@ enum {
|
|||
ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL,
|
||||
ACTION_USB_HID_MOUSE_BUTTON_RIGHT,
|
||||
ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL,
|
||||
ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP,
|
||||
ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN,
|
||||
ACTION_USB_HID_LAST, /* Place holder */
|
||||
|
||||
LAST_ACTION_PLACEHOLDER, /* custom actions should be this + something */
|
||||
|
|
|
@ -263,6 +263,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -271,6 +273,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_POWER|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_POWER|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_POWER|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -279,10 +283,10 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_POWER|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_POWER|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_POWER|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
|
|
|
@ -288,6 +288,7 @@ static const struct button_mapping button_context_usb_hid[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
static const struct button_mapping button_context_usb_hid_mouse[] = {
|
||||
{ ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
@ -297,6 +298,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -305,6 +308,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_POWER|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_POWER|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_POWER|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -313,14 +318,15 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_POWER|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_POWER|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_POWER|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
#endif
|
||||
#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)
|
||||
|
@ -371,8 +377,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#ifdef USB_ENABLE_HID
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
case CONTEXT_USB_HID_MOUSE:
|
||||
return button_context_usb_hid_mouse;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
return button_context_standard;
|
||||
|
|
|
@ -297,6 +297,7 @@ static const struct button_mapping button_context_usb_hid[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
static const struct button_mapping button_context_usb_hid_mouse[] = {
|
||||
{ ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
@ -306,6 +307,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -314,6 +317,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_HOME, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_HOME|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_HOME|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_HOME|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_HOME|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -322,14 +327,15 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_HOME|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_HOME|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_HOME|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_HOME, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_HOME|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
#endif
|
||||
#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)
|
||||
|
@ -381,8 +387,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#ifdef USB_ENABLE_HID
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
case CONTEXT_USB_HID_MOUSE:
|
||||
return button_context_usb_hid_mouse;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
return button_context_standard;
|
||||
|
|
|
@ -299,6 +299,7 @@ static const struct button_mapping button_context_usb_hid[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
static const struct button_mapping button_context_usb_hid_mouse[] = {
|
||||
{ ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
@ -308,6 +309,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -316,6 +319,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_POWER|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_POWER|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_POWER|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -324,14 +329,15 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_POWER|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_POWER|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_POWER|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_SCROLL_BACK, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_SCROLL_FWD, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
#endif
|
||||
#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)
|
||||
|
@ -383,8 +389,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#ifdef USB_ENABLE_HID
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
case CONTEXT_USB_HID_MOUSE:
|
||||
return button_context_usb_hid_mouse;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
return button_context_standard;
|
||||
|
|
|
@ -511,6 +511,7 @@ static const struct button_mapping remote_button_context_usb_hid[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* remote_button_context_usb_hid */
|
||||
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
static const struct button_mapping button_context_usb_hid_mouse[] = {
|
||||
{ ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
@ -528,14 +529,20 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_BACK|BUTTON_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_BACK|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_BACK|BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_BACK|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_BACK|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_BACK, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_BACK|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_BACK|BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_BACK|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_BACK|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_BACK|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_MENU|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_MENU|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_MENU|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -544,16 +551,15 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_MENU|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_MENU|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_MENU|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_BACK, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_BACK|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static const struct button_mapping* get_context_mapping_remote( int context )
|
||||
{
|
||||
|
@ -671,8 +677,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#ifdef USB_ENABLE_HID
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
case CONTEXT_USB_HID_MOUSE:
|
||||
return button_context_usb_hid_mouse;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
return button_context_standard;
|
||||
|
|
|
@ -357,6 +357,41 @@ static const struct button_mapping button_context_usb_hid[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
static const struct button_mapping button_context_usb_hid_mouse[] = {
|
||||
{ ACTION_USB_HID_MOUSE_UP, BUTTON_SCROLL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LEFT, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_POWER|BUTTON_SCROLL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_POWER|BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_POWER|BUTTON_SCROLL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_POWER|BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_POWER|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_POWER|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_POWER|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_PLAY|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_PLAY|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_PLAY|BUTTON_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_PLAY|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_PLAY|BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_PLAY|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_PLAY|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_PLAY|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
#endif
|
||||
|
||||
static const struct button_mapping remote_button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_INC, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
@ -463,6 +498,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#ifdef USB_ENABLE_HID
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
case CONTEXT_USB_HID_MOUSE:
|
||||
return button_context_usb_hid_mouse;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
return button_context_standard;
|
||||
|
|
|
@ -308,6 +308,7 @@ static const struct button_mapping button_context_usb_hid[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
static const struct button_mapping button_context_usb_hid_mouse[] = {
|
||||
{ ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
@ -317,6 +318,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -325,6 +328,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_POWER|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_POWER|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_POWER|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -333,14 +338,16 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_POWER|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_POWER|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_POWER|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
const struct button_mapping* get_context_mapping(int context)
|
||||
{
|
||||
|
@ -392,8 +399,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#ifdef USB_ENABLE_HID
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
case CONTEXT_USB_HID_MOUSE:
|
||||
return button_context_usb_hid_mouse;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return button_context_standard;
|
||||
|
|
|
@ -213,6 +213,7 @@ static const struct button_mapping button_context_usb_hid[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
static const struct button_mapping button_context_usb_hid_mouse[] = {
|
||||
{ ACTION_USB_HID_MOUSE_UP, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
@ -222,6 +223,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_PLAY, BUTTON_NONE },
|
||||
|
@ -230,12 +233,15 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_SCROLL_BACK, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_SCROLL_FWD, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BUTTON_REMOTE != 0
|
||||
/*****************************************************************************
|
||||
|
@ -284,6 +290,37 @@ static const struct button_mapping remote_button_context_usb_hid[] = {
|
|||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* remote_button_context_usb_hid */
|
||||
|
||||
#if 0 /* Pending P#10623: Improved accessory support and detection for Ipod */
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
static const struct button_mapping remote_button_context_usb_hid_mouse[] = {
|
||||
{ ACTION_USB_HID_MOUSE_UP, BUTTON_RC_MENU, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_DOWN, BUTTON_RC_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LEFT, BUTTON_RC_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RC_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_RC_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_RC_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_RC_SELECT|BUTTON_RC_MENU, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_RC_SELECT|BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_RC_SELECT|BUTTON_RC_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_RC_SELECT|BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_RC_SELECT|BUTTON_RC_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_RC_SELECT|BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_RC_SELECT|BUTTON_RC_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_RC_SELECT|BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* remote_button_context_usb_hid_mouse */
|
||||
#endif
|
||||
#endif /* if 0 */
|
||||
#endif
|
||||
|
||||
static const struct button_mapping* get_context_mapping_remote( int context )
|
||||
|
@ -297,6 +334,12 @@ static const struct button_mapping* get_context_mapping_remote( int context )
|
|||
#ifdef USB_ENABLE_HID
|
||||
case CONTEXT_USB_HID:
|
||||
return remote_button_context_usb_hid;
|
||||
#if 0 /* Pending P#10623: Improved accessory support and detection for Ipod */
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
case CONTEXT_USB_HID_MOUSE:
|
||||
return remote_button_context_usb_hid_mouse;
|
||||
#endif
|
||||
#endif /* If 0 */
|
||||
#endif
|
||||
default:
|
||||
return remote_button_context_standard;
|
||||
|
@ -353,8 +396,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#ifdef USB_ENABLE_HID
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
case CONTEXT_USB_HID_MOUSE:
|
||||
return button_context_usb_hid_mouse;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
return button_context_standard;
|
||||
|
|
|
@ -356,14 +356,20 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_MENU|BUTTON_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_MENU|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_MENU|BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_MENU|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_MENU|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_MENU|BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_MENU|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_MENU|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_MENU|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_PLAY|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_PLAY|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_PLAY|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -372,12 +378,6 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_PLAY|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_PLAY|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_PLAY|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_PLAY, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
|
|
|
@ -304,6 +304,7 @@ static const struct button_mapping button_context_usb_hid[] = {
|
|||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
static const struct button_mapping button_context_usb_hid_mouse[] = {
|
||||
{ ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
@ -313,6 +314,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_PREV, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_PREV|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_PREV|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_PREV|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_PREV|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -321,6 +324,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_PREV|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_PREV|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_PREV|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_NEXT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_NEXT|BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_NEXT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_NEXT|BUTTON_DOWN, BUTTON_NONE },
|
||||
|
@ -329,14 +334,15 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
|
|||
{ ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_NEXT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_NEXT|BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_NEXT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_PREV, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_PREV|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_NEXT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
|
||||
}; /* button_context_usb_hid_mouse */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
const struct button_mapping* get_context_mapping(int context)
|
||||
{
|
||||
|
@ -388,8 +394,10 @@ const struct button_mapping* get_context_mapping(int context)
|
|||
#ifdef USB_ENABLE_HID
|
||||
case CONTEXT_USB_HID:
|
||||
return button_context_usb_hid;
|
||||
#ifdef HAVE_USB_HID_MOUSE
|
||||
case CONTEXT_USB_HID_MOUSE:
|
||||
return button_context_usb_hid_mouse;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return button_context_standard;
|
||||
|
|
|
@ -177,9 +177,9 @@ static const hid_key_mapping_t hid_key_mapping_mouse = {
|
|||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT, HID_MOUSE_BUTTON_RIGHT },
|
||||
{ ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, HID_MOUSE_BUTTON_RIGHT_REL },
|
||||
/* Mouse wheel scroll up */
|
||||
{ ACTION_USB_HID_DEC, HID_MOUSE_SCROLL_UP },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, HID_MOUSE_SCROLL_UP },
|
||||
/* Mouse wheel scroll down */
|
||||
{ ACTION_USB_HID_INC, HID_MOUSE_SCROLL_DOWN },
|
||||
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, HID_MOUSE_SCROLL_DOWN },
|
||||
{ 0, 0 },
|
||||
}
|
||||
};
|
||||
|
|
|
@ -173,6 +173,7 @@
|
|||
#define USE_ROCKBOX_USB
|
||||
#define USB_VENDOR_ID 0x0B70
|
||||
#define USB_PRODUCT_ID 0x00BA
|
||||
#define HAVE_USB_HID_MOUSE
|
||||
|
||||
/* Define this if you have adjustable CPU frequency */
|
||||
#define HAVE_ADJUSTABLE_CPU_FREQ
|
||||
|
|
|
@ -153,6 +153,7 @@
|
|||
#define USE_ROCKBOX_USB
|
||||
#define USB_VENDOR_ID 0x0B70
|
||||
#define USB_PRODUCT_ID 0x00BA
|
||||
#define HAVE_USB_HID_MOUSE
|
||||
|
||||
/* Define this if you have adjustable CPU frequency */
|
||||
#define HAVE_ADJUSTABLE_CPU_FREQ
|
||||
|
|
Loading…
Reference in a new issue