From 0c379b4b2ef463d90625d7e0c535d45bde6949cb Mon Sep 17 00:00:00 2001 From: Tomer Shalev Date: Mon, 5 Oct 2009 06:42:39 +0000 Subject: [PATCH] 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 --- apps/action.h | 2 + apps/keymaps/keymap-c100.c | 60 ++++++++++++----------- apps/keymaps/keymap-c200.c | 64 +++++++++++++----------- apps/keymaps/keymap-clip.c | 64 +++++++++++++----------- apps/keymaps/keymap-e200.c | 64 +++++++++++++----------- apps/keymaps/keymap-gigabeat-s.c | 84 +++++++++++++++++--------------- apps/keymaps/keymap-h10.c | 39 +++++++++++++++ apps/keymaps/keymap-hdd1630.c | 65 +++++++++++++----------- apps/keymaps/keymap-ipod.c | 81 +++++++++++++++++++++++------- apps/keymaps/keymap-mr100.c | 18 +++---- apps/keymaps/keymap-sa9200.c | 64 +++++++++++++----------- apps/usb_keymaps.c | 60 +++++++++++------------ firmware/export/config-h10.h | 1 + firmware/export/config-h10_5gb.h | 1 + 14 files changed, 404 insertions(+), 263 deletions(-) diff --git a/apps/action.h b/apps/action.h index 39e3e09d73..24250ef869 100644 --- a/apps/action.h +++ b/apps/action.h @@ -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 */ diff --git a/apps/keymaps/keymap-c100.c b/apps/keymaps/keymap-c100.c index fcb747b5fd..7ee400f345 100644 --- a/apps/keymaps/keymap-c100.c +++ b/apps/keymaps/keymap-c100.c @@ -255,34 +255,38 @@ static const struct button_mapping button_context_usb_hid[] = { }; /* button_context_usb_hid */ 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 }, - { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, - { 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_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 }, - { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE }, - { 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_UP, BUTTON_UP, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, + { 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 }, + { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE }, + { 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_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 */ diff --git a/apps/keymaps/keymap-c200.c b/apps/keymaps/keymap-c200.c index fa6c64cec8..7acbe85420 100644 --- a/apps/keymaps/keymap-c200.c +++ b/apps/keymaps/keymap-c200.c @@ -288,39 +288,45 @@ 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 }, - { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, - { 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_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 }, - { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE }, - { 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_UP, BUTTON_UP, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, + { 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 }, + { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE }, + { 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_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; diff --git a/apps/keymaps/keymap-clip.c b/apps/keymaps/keymap-clip.c index 21728db7fb..b2821664d7 100644 --- a/apps/keymaps/keymap-clip.c +++ b/apps/keymaps/keymap-clip.c @@ -297,39 +297,45 @@ 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 }, - { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, - { 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_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 }, - { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_HOME|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_HOME|BUTTON_LEFT, BUTTON_NONE }, - { 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_UP, BUTTON_UP, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, + { 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 }, + { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_HOME|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_HOME|BUTTON_LEFT, BUTTON_NONE }, + { 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_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; diff --git a/apps/keymaps/keymap-e200.c b/apps/keymaps/keymap-e200.c index ef5c932f20..23e8dbcf83 100644 --- a/apps/keymaps/keymap-e200.c +++ b/apps/keymaps/keymap-e200.c @@ -299,39 +299,45 @@ 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 }, - { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, - { 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_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 }, - { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE }, - { 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_UP, BUTTON_UP, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, + { 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 }, + { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE }, + { 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_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; diff --git a/apps/keymaps/keymap-gigabeat-s.c b/apps/keymaps/keymap-gigabeat-s.c index a6b0b8bc68..c959eb09ba 100644 --- a/apps/keymaps/keymap-gigabeat-s.c +++ b/apps/keymaps/keymap-gigabeat-s.c @@ -511,49 +511,55 @@ 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 }, - { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_BACK|BUTTON_UP, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_BACK|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE }, - { 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_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_LDRAG_RIGHT_REP, BUTTON_BACK|BUTTON_RIGHT|BUTTON_REPEAT, 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 }, - { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_MENU|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_MENU|BUTTON_LEFT, BUTTON_NONE }, - { 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_UP, BUTTON_UP, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_BACK|BUTTON_UP, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_BACK|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE }, + { 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_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_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 }, + { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_MENU|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_MENU|BUTTON_LEFT, BUTTON_NONE }, + { 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_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; diff --git a/apps/keymaps/keymap-h10.c b/apps/keymaps/keymap-h10.c index 81673397c3..fcfde112fb 100644 --- a/apps/keymaps/keymap-h10.c +++ b/apps/keymaps/keymap-h10.c @@ -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; diff --git a/apps/keymaps/keymap-hdd1630.c b/apps/keymaps/keymap-hdd1630.c index ddb357a8b1..404d7ecf14 100644 --- a/apps/keymaps/keymap-hdd1630.c +++ b/apps/keymaps/keymap-hdd1630.c @@ -308,39 +308,46 @@ 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 }, - { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, - { 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_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 }, - { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE }, - { 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_UP, BUTTON_UP, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, + { 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 }, + { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE }, + { 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_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; diff --git a/apps/keymaps/keymap-ipod.c b/apps/keymaps/keymap-ipod.c index 2b34fbc157..199524e6af 100644 --- a/apps/keymaps/keymap-ipod.c +++ b/apps/keymaps/keymap-ipod.c @@ -213,29 +213,35 @@ 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 }, - { ACTION_USB_HID_MOUSE_DOWN, BUTTON_PLAY, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_PLAY|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_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 }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, - { 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_UP, BUTTON_MENU, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN, BUTTON_PLAY, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_PLAY|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_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 }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, + { 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_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; diff --git a/apps/keymaps/keymap-mr100.c b/apps/keymaps/keymap-mr100.c index dc8c765a01..79a12428f7 100644 --- a/apps/keymaps/keymap-mr100.c +++ b/apps/keymaps/keymap-mr100.c @@ -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 */ diff --git a/apps/keymaps/keymap-sa9200.c b/apps/keymaps/keymap-sa9200.c index 86f608ec35..1d14a67147 100644 --- a/apps/keymaps/keymap-sa9200.c +++ b/apps/keymaps/keymap-sa9200.c @@ -304,39 +304,45 @@ 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 }, - { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_PREV|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_PREV|BUTTON_LEFT, BUTTON_NONE }, - { 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_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 }, - { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_NEXT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_NEXT|BUTTON_LEFT, BUTTON_NONE }, - { 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_UP, BUTTON_UP, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_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_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 }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_PREV|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_PREV|BUTTON_LEFT, BUTTON_NONE }, + { 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 }, + { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_NEXT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_NEXT|BUTTON_LEFT, BUTTON_NONE }, + { 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_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; diff --git a/apps/usb_keymaps.c b/apps/usb_keymaps.c index 23f7333a64..41387a1005 100644 --- a/apps/usb_keymaps.c +++ b/apps/usb_keymaps.c @@ -143,43 +143,43 @@ static const hid_key_mapping_t hid_key_mapping_mouse = { HID_USAGE_PAGE_GENERIC_DESKTOP_CONTROLS, { /* Cursor move up */ - { ACTION_USB_HID_MOUSE_UP, HID_MOUSE_UP }, - { ACTION_USB_HID_MOUSE_UP_REP, HID_MOUSE_UP_REP }, - { ACTION_USB_HID_MOUSE_LDRAG_UP, HID_MOUSE_LDRAG_UP }, - { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, HID_MOUSE_LDRAG_UP_REP }, - { ACTION_USB_HID_MOUSE_RDRAG_UP, HID_MOUSE_RDRAG_UP }, - { ACTION_USB_HID_MOUSE_RDRAG_UP_REP, HID_MOUSE_RDRAG_UP_REP }, + { ACTION_USB_HID_MOUSE_UP, HID_MOUSE_UP }, + { ACTION_USB_HID_MOUSE_UP_REP, HID_MOUSE_UP_REP }, + { ACTION_USB_HID_MOUSE_LDRAG_UP, HID_MOUSE_LDRAG_UP }, + { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, HID_MOUSE_LDRAG_UP_REP }, + { ACTION_USB_HID_MOUSE_RDRAG_UP, HID_MOUSE_RDRAG_UP }, + { ACTION_USB_HID_MOUSE_RDRAG_UP_REP, HID_MOUSE_RDRAG_UP_REP }, /* Cursor move down */ - { ACTION_USB_HID_MOUSE_DOWN, HID_MOUSE_DOWN }, - { ACTION_USB_HID_MOUSE_DOWN_REP, HID_MOUSE_DOWN_REP }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN, HID_MOUSE_LDRAG_DOWN }, - { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, HID_MOUSE_LDRAG_DOWN_REP }, - { ACTION_USB_HID_MOUSE_RDRAG_DOWN, HID_MOUSE_RDRAG_DOWN }, - { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, HID_MOUSE_RDRAG_DOWN_REP }, + { ACTION_USB_HID_MOUSE_DOWN, HID_MOUSE_DOWN }, + { ACTION_USB_HID_MOUSE_DOWN_REP, HID_MOUSE_DOWN_REP }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN, HID_MOUSE_LDRAG_DOWN }, + { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, HID_MOUSE_LDRAG_DOWN_REP }, + { ACTION_USB_HID_MOUSE_RDRAG_DOWN, HID_MOUSE_RDRAG_DOWN }, + { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, HID_MOUSE_RDRAG_DOWN_REP }, /* Cursor move left */ - { ACTION_USB_HID_MOUSE_LEFT, HID_MOUSE_LEFT }, - { ACTION_USB_HID_MOUSE_LEFT_REP, HID_MOUSE_LEFT_REP }, - { ACTION_USB_HID_MOUSE_LDRAG_LEFT, HID_MOUSE_LDRAG_LEFT }, - { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, HID_MOUSE_LDRAG_LEFT_REP }, - { ACTION_USB_HID_MOUSE_RDRAG_LEFT, HID_MOUSE_RDRAG_LEFT }, - { ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, HID_MOUSE_RDRAG_LEFT_REP }, + { ACTION_USB_HID_MOUSE_LEFT, HID_MOUSE_LEFT }, + { ACTION_USB_HID_MOUSE_LEFT_REP, HID_MOUSE_LEFT_REP }, + { ACTION_USB_HID_MOUSE_LDRAG_LEFT, HID_MOUSE_LDRAG_LEFT }, + { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, HID_MOUSE_LDRAG_LEFT_REP }, + { ACTION_USB_HID_MOUSE_RDRAG_LEFT, HID_MOUSE_RDRAG_LEFT }, + { ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, HID_MOUSE_RDRAG_LEFT_REP }, /* Cursor move right */ - { ACTION_USB_HID_MOUSE_RIGHT, HID_MOUSE_RIGHT }, - { ACTION_USB_HID_MOUSE_RIGHT_REP, HID_MOUSE_RIGHT_REP }, - { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, HID_MOUSE_LDRAG_RIGHT }, - { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, HID_MOUSE_LDRAG_RIGHT_REP }, - { ACTION_USB_HID_MOUSE_RDRAG_RIGHT, HID_MOUSE_RDRAG_RIGHT }, - { ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, HID_MOUSE_RDRAG_RIGHT_REP }, + { ACTION_USB_HID_MOUSE_RIGHT, HID_MOUSE_RIGHT }, + { ACTION_USB_HID_MOUSE_RIGHT_REP, HID_MOUSE_RIGHT_REP }, + { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, HID_MOUSE_LDRAG_RIGHT }, + { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, HID_MOUSE_LDRAG_RIGHT_REP }, + { ACTION_USB_HID_MOUSE_RDRAG_RIGHT, HID_MOUSE_RDRAG_RIGHT }, + { ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, HID_MOUSE_RDRAG_RIGHT_REP }, /* Mouse button left-click */ - { ACTION_USB_HID_MOUSE_BUTTON_LEFT, HID_MOUSE_BUTTON_LEFT }, - { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, HID_MOUSE_BUTTON_LEFT_REL }, + { ACTION_USB_HID_MOUSE_BUTTON_LEFT, HID_MOUSE_BUTTON_LEFT }, + { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, HID_MOUSE_BUTTON_LEFT_REL }, /* Mouse button right-click */ - { ACTION_USB_HID_MOUSE_BUTTON_RIGHT, HID_MOUSE_BUTTON_RIGHT }, - { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, HID_MOUSE_BUTTON_RIGHT_REL }, + { 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 }, } }; diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h index 0dc845c23b..5ac12af3fc 100644 --- a/firmware/export/config-h10.h +++ b/firmware/export/config-h10.h @@ -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 diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h index 8275e50dc6..e39c6a6bbf 100644 --- a/firmware/export/config-h10_5gb.h +++ b/firmware/export/config-h10_5gb.h @@ -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