summaryrefslogtreecommitdiff
path: root/apps/keymaps/keymap-h10.c
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2009-10-17 15:20:23 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2009-10-17 15:20:23 +0000
commit88b1efd92579248c4d17d1edf7a7b02041c0e003 (patch)
treed63bffb4a95386e9f5d12dbf2c41e5576b926787 /apps/keymaps/keymap-h10.c
parent79f19b939f63a1a965bcc9f90cf9b6c8822620cc (diff)
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
Diffstat (limited to 'apps/keymaps/keymap-h10.c')
-rw-r--r--apps/keymaps/keymap-h10.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/apps/keymaps/keymap-h10.c b/apps/keymaps/keymap-h10.c
index 9b7800a3da..0106a8c86f 100644
--- a/apps/keymaps/keymap-h10.c
+++ b/apps/keymaps/keymap-h10.c
@@ -398,6 +398,35 @@ static const struct button_mapping button_context_usb_hid_mode_browser[] = {
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
}; /* 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
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
case 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
default:
return button_context_standard;