USB HID: Add mouse mode to h10

- Also fix bug where all other modes were not functional
- Hopefully fixes FS#10651 - H10 USB HID keymap problem


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23228 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomer Shalev 2009-10-17 15:20:23 +00:00
parent 79f19b939f
commit 88b1efd925
4 changed files with 45 additions and 0 deletions

View file

@ -398,6 +398,35 @@ static const struct button_mapping button_context_usb_hid_mode_browser[] = {
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
}; /* button_context_usb_hid_mode_browser */ }; /* button_context_usb_hid_mode_browser */
#ifdef HAVE_USB_HID_MOUSE
static const struct button_mapping button_context_usb_hid_mode_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_PLAY, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_PLAY|BUTTON_SCROLL_UP, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_PLAY|BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_PLAY|BUTTON_SCROLL_DOWN, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_PLAY|BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_PLAY|BUTTON_LEFT, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_PLAY|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_PLAY|BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_PLAY|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_REW, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_FF, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_FF|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
}; /* button_context_usb_hid_mode_mouse */
#endif
#endif #endif
static const struct button_mapping* get_context_mapping_remote( int context ) static const struct button_mapping* get_context_mapping_remote( int context )
@ -485,6 +514,16 @@ const struct button_mapping* get_context_mapping(int context)
#ifdef USB_ENABLE_HID #ifdef USB_ENABLE_HID
case CONTEXT_USB_HID: case CONTEXT_USB_HID:
return button_context_usb_hid; return button_context_usb_hid;
case CONTEXT_USB_HID_MODE_MULTIMEDIA:
return button_context_usb_hid_mode_multimedia;
case CONTEXT_USB_HID_MODE_PRESENTATION:
return button_context_usb_hid_mode_presentation;
case CONTEXT_USB_HID_MODE_BROWSER:
return button_context_usb_hid_mode_browser;
#ifdef HAVE_USB_HID_MOUSE
case CONTEXT_USB_HID_MODE_MOUSE:
return button_context_usb_hid_mode_mouse;
#endif
#endif #endif
default: default:
return button_context_standard; return button_context_standard;

View file

@ -173,6 +173,7 @@
#define USE_ROCKBOX_USB #define USE_ROCKBOX_USB
#define USB_VENDOR_ID 0x0B70 #define USB_VENDOR_ID 0x0B70
#define USB_PRODUCT_ID 0x00BA #define USB_PRODUCT_ID 0x00BA
#define HAVE_USB_HID_MOUSE
/* Define this if you have adjustable CPU frequency */ /* Define this if you have adjustable CPU frequency */
#define HAVE_ADJUSTABLE_CPU_FREQ #define HAVE_ADJUSTABLE_CPU_FREQ

View file

@ -153,6 +153,7 @@
#define USE_ROCKBOX_USB #define USE_ROCKBOX_USB
#define USB_VENDOR_ID 0x0B70 #define USB_VENDOR_ID 0x0B70
#define USB_PRODUCT_ID 0x00BA #define USB_PRODUCT_ID 0x00BA
#define HAVE_USB_HID_MOUSE
/* Define this if you have adjustable CPU frequency */ /* Define this if you have adjustable CPU frequency */
#define HAVE_ADJUSTABLE_CPU_FREQ #define HAVE_ADJUSTABLE_CPU_FREQ

View file

@ -566,6 +566,8 @@ this option \setting{On}. If it is not required, then turning this setting
\opt{SANSA_E200_PAD,GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% \opt{SANSA_E200_PAD,GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
,MROBE100_PAD} ,MROBE100_PAD}
{\ButtonUp / \ButtonDown / \ButtonLeft / \ButtonRight} {\ButtonUp / \ButtonDown / \ButtonLeft / \ButtonRight}
\opt{IRIVER_H10_PAD}
{\ButtonScrollUp / \ButtonScrollDown / \ButtonLeft / \ButtonRight}
\opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}
{\ButtonMenu / \ButtonPlay / \ButtonLeft / \ButtonRight} {\ButtonMenu / \ButtonPlay / \ButtonLeft / \ButtonRight}
\opt{HAVEREMOTEKEYMAP}{ \opt{HAVEREMOTEKEYMAP}{
@ -579,6 +581,7 @@ this option \setting{On}. If it is not required, then turning this setting
,IPOD_3G_PAD,IPOD_1G2G_PAD} ,IPOD_3G_PAD,IPOD_1G2G_PAD}
{\ButtonSelect} {\ButtonSelect}
\opt{GIGABEAT_S_PAD}{\ButtonSelect; \ButtonBack} \opt{GIGABEAT_S_PAD}{\ButtonSelect; \ButtonBack}
\opt{IRIVER_H10_PAD}{\ButtonPlay}
\opt{MROBE100_PAD}{\ButtonMenu} \opt{MROBE100_PAD}{\ButtonMenu}
\opt{HAVEREMOTEKEYMAP}{ \opt{HAVEREMOTEKEYMAP}{
& &
@ -598,6 +601,7 @@ this option \setting{On}. If it is not required, then turning this setting
% Mouse wheel scroll up / down % Mouse wheel scroll up / down
\opt{SANSA_E200_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} \opt{SANSA_E200_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}
{\ButtonScrollBack / \ButtonScrollFwd} {\ButtonScrollBack / \ButtonScrollFwd}
\opt{IRIVER_H10_PAD}{\ButtonRew / \ButtonFF}
\opt{GIGABEAT_S_PAD} \opt{GIGABEAT_S_PAD}
{\ButtonVolUp; \ButtonPrev / \ButtonVolDown; \ButtonNext} {\ButtonVolUp; \ButtonPrev / \ButtonVolDown; \ButtonNext}
\opt{SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD} \opt{SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD}