summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2009-10-17 05:39:54 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2009-10-17 05:39:54 +0000
commit4f3d7b5bcb0b025332e128c3856aa9d4cce91898 (patch)
treeac2f783e9585c476fbaa9dfaf3a7a34e826f7ccc /apps
parent6d4d44caf69e06ea51937da9c74e78af0ac99a62 (diff)
downloadrockbox-4f3d7b5bcb0b025332e128c3856aa9d4cce91898.tar.gz
rockbox-4f3d7b5bcb0b025332e128c3856aa9d4cce91898.tar.bz2
rockbox-4f3d7b5bcb0b025332e128c3856aa9d4cce91898.zip
USB HID: Use different context for each mode; Use constant for each action;
Rework keymaps This commit makes the code neater and more readable. It makes it easier to modify keymap assignments and new keypad modes. Some platforms had their keypad mappings reworked. The manual is updated to reflect all these changes. H10 remote control mapping dropped. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23219 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/action.h56
-rw-r--r--apps/keymaps/keymap-c100.c90
-rw-r--r--apps/keymaps/keymap-c200.c88
-rw-r--r--apps/keymaps/keymap-clip.c88
-rw-r--r--apps/keymaps/keymap-e200.c88
-rw-r--r--apps/keymaps/keymap-gigabeat-s.c197
-rw-r--r--apps/keymaps/keymap-h10.c119
-rw-r--r--apps/keymaps/keymap-hdd1630.c164
-rw-r--r--apps/keymaps/keymap-ipod.c148
-rw-r--r--apps/keymaps/keymap-mr100.c273
-rw-r--r--apps/keymaps/keymap-ondavx747.c55
-rw-r--r--apps/keymaps/keymap-sa9200.c97
-rw-r--r--apps/keymaps/keymap-touchscreen.c83
-rw-r--r--apps/screens.c4
-rw-r--r--apps/usb_keymaps.c117
15 files changed, 1112 insertions, 555 deletions
diff --git a/apps/action.h b/apps/action.h
index 8d8e8f50fd..0738b114da 100644
--- a/apps/action.h
+++ b/apps/action.h
@@ -77,7 +77,10 @@ enum {
CONTEXT_KEYBOARD,
CONTEXT_FM,
CONTEXT_USB_HID,
- CONTEXT_USB_HID_MOUSE,
+ CONTEXT_USB_HID_MODE_MULTIMEDIA,
+ CONTEXT_USB_HID_MODE_PRESENTATION,
+ CONTEXT_USB_HID_MODE_BROWSER,
+ CONTEXT_USB_HID_MODE_MOUSE,
};
@@ -244,22 +247,41 @@ enum {
/* USB HID codes */
ACTION_USB_HID_FIRST, /* Place holder */
- ACTION_USB_HID_DEC,
- ACTION_USB_HID_INC,
- ACTION_USB_HID_START,
- ACTION_USB_HID_START_LONG,
- ACTION_USB_HID_QUIT,
- ACTION_USB_HID_QUIT_LONG,
- ACTION_USB_HID_LEFT,
- ACTION_USB_HID_LEFT_LONG,
- ACTION_USB_HID_RIGHT,
- ACTION_USB_HID_RIGHT_LONG,
- ACTION_USB_HID_SELECT,
- ACTION_USB_HID_SELECT_LONG,
- ACTION_USB_HID_MENU,
- ACTION_USB_HID_MENU_LONG,
- ACTION_USB_HID_MODE,
- ACTION_USB_HID_MODE_LONG,
+ ACTION_USB_HID_NONE,
+ ACTION_USB_HID_MODE_SWITCH_NEXT,
+ ACTION_USB_HID_MODE_SWITCH_PREV,
+ ACTION_USB_HID_MULTIMEDIA_VOLUME_UP,
+ ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN,
+ ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE,
+ ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE,
+ ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP,
+ ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV,
+ ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT,
+ ACTION_USB_HID_PRESENTATION_SLIDESHOW_START,
+ ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE,
+ ACTION_USB_HID_PRESENTATION_SLIDE_PREV,
+ ACTION_USB_HID_PRESENTATION_SLIDE_NEXT,
+ ACTION_USB_HID_PRESENTATION_SLIDE_FIRST,
+ ACTION_USB_HID_PRESENTATION_SLIDE_LAST,
+ ACTION_USB_HID_PRESENTATION_SCREEN_BLACK,
+ ACTION_USB_HID_PRESENTATION_SCREEN_WHITE,
+ ACTION_USB_HID_PRESENTATION_LINK_PREV,
+ ACTION_USB_HID_PRESENTATION_LINK_NEXT,
+ ACTION_USB_HID_PRESENTATION_MOUSE_CLICK,
+ ACTION_USB_HID_PRESENTATION_MOUSE_OVER,
+ ACTION_USB_HID_BROWSER_SCROLL_UP,
+ ACTION_USB_HID_BROWSER_SCROLL_DOWN,
+ ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN,
+ ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP,
+ ACTION_USB_HID_BROWSER_ZOOM_IN,
+ ACTION_USB_HID_BROWSER_ZOOM_OUT,
+ ACTION_USB_HID_BROWSER_ZOOM_RESET,
+ ACTION_USB_HID_BROWSER_TAB_PREV,
+ ACTION_USB_HID_BROWSER_TAB_NEXT,
+ ACTION_USB_HID_BROWSER_TAB_CLOSE,
+ ACTION_USB_HID_BROWSER_HISTORY_BACK,
+ ACTION_USB_HID_BROWSER_HISTORY_FORWARD,
+ ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN,
ACTION_USB_HID_MOUSE_UP,
ACTION_USB_HID_MOUSE_UP_REP,
ACTION_USB_HID_MOUSE_DOWN,
diff --git a/apps/keymaps/keymap-c100.c b/apps/keymaps/keymap-c100.c
index 7ee400f345..457e81ed99 100644
--- a/apps/keymaps/keymap-c100.c
+++ b/apps/keymaps/keymap-c100.c
@@ -234,27 +234,68 @@ static const struct button_mapping button_context_bmark[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
- { ACTION_USB_HID_START_LONG, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
- { ACTION_USB_HID_QUIT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_USB_HID_MENU, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
- { ACTION_USB_HID_MODE, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
-static const struct button_mapping button_context_usb_hid_mouse[] = {
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOLUP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOLDOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOLUP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOLDOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOLUP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOLDOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_UP|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_UP|BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+
+ 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_UP, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE },
@@ -289,7 +330,8 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
{ 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 */
+}; /* button_context_usb_hid_mode_mouse */
+#endif
#endif
/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
@@ -343,8 +385,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_MOUSE:
- return button_context_usb_hid_mouse;
+ 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;
diff --git a/apps/keymaps/keymap-c200.c b/apps/keymaps/keymap-c200.c
index 7acbe85420..af7c990340 100644
--- a/apps/keymaps/keymap-c200.c
+++ b/apps/keymaps/keymap-c200.c
@@ -266,30 +266,68 @@ static const struct button_mapping button_context_bmark[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_VOL_UP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
- { ACTION_USB_HID_START_LONG, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
- { ACTION_USB_HID_QUIT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_USB_HID_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
- { ACTION_USB_HID_MENU_LONG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
- { ACTION_USB_HID_MODE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
- { ACTION_USB_HID_MODE_LONG, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_REC|BUTTON_REL, BUTTON_REC },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_UP|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_UP|BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+
+ 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_mouse[] = {
+static const struct button_mapping button_context_usb_hid_mode_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 },
@@ -324,7 +362,7 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
{ 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 */
+}; /* button_context_usb_hid_mode_mouse */
#endif
#endif
@@ -377,9 +415,15 @@ 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_MOUSE:
- return button_context_usb_hid_mouse;
+ case CONTEXT_USB_HID_MODE_MOUSE:
+ return button_context_usb_hid_mode_mouse;
#endif
#endif
default:
diff --git a/apps/keymaps/keymap-clip.c b/apps/keymaps/keymap-clip.c
index b2821664d7..ddc1d3f82a 100644
--- a/apps/keymaps/keymap-clip.c
+++ b/apps/keymaps/keymap-clip.c
@@ -275,30 +275,68 @@ static const struct button_mapping button_context_bmark[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_VOL_UP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
- { ACTION_USB_HID_START_LONG, BUTTON_UP|BOTTOM_REPEAT, BUTTON_UP },
- { ACTION_USB_HID_QUIT, BUTTON_HOME|BUTTON_REL, BUTTON_HOME },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_HOME|BUTTON_REPEAT, BUTTON_HOME },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_USB_HID_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
- { ACTION_USB_HID_MENU_LONG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
- { ACTION_USB_HID_MODE, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_MODE_LONG, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_HOME|BUTTON_REL, BUTTON_HOME },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_HOME|BUTTON_REL, BUTTON_HOME },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_UP|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_UP|BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_HOME|BUTTON_REPEAT, BUTTON_HOME },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+
+ 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_mouse[] = {
+static const struct button_mapping button_context_usb_hid_mode_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 },
@@ -333,7 +371,7 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
{ 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 */
+}; /* button_context_usb_hid_mode_mouse */
#endif
#endif
@@ -387,9 +425,15 @@ 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_MOUSE:
- return button_context_usb_hid_mouse;
+ case CONTEXT_USB_HID_MODE_MOUSE:
+ return button_context_usb_hid_mode_mouse;
#endif
#endif
default:
diff --git a/apps/keymaps/keymap-e200.c b/apps/keymaps/keymap-e200.c
index 23e8dbcf83..487fb11130 100644
--- a/apps/keymaps/keymap-e200.c
+++ b/apps/keymaps/keymap-e200.c
@@ -277,30 +277,68 @@ static const struct button_mapping button_context_bmark[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_SCROLL_FWD, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_SCROLL_BACK, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
- { ACTION_USB_HID_START_LONG, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
- { ACTION_USB_HID_QUIT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_USB_HID_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
- { ACTION_USB_HID_MENU_LONG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
- { ACTION_USB_HID_MODE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
- { ACTION_USB_HID_MODE_LONG, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_REC|BUTTON_REL, BUTTON_REC },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_SCROLL_BACK, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_SCROLL_FWD, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_SCROLL_BACK, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_SCROLL_FWD, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_SCROLL_BACK, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_SCROLL_FWD, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_UP|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_UP|BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+
+ 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_mouse[] = {
+static const struct button_mapping button_context_usb_hid_mode_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 },
@@ -335,7 +373,7 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
{ 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 */
+}; /* button_context_usb_hid_mode_mouse */
#endif
#endif
@@ -389,9 +427,15 @@ 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_MOUSE:
- return button_context_usb_hid_mouse;
+ case CONTEXT_USB_HID_MODE_MOUSE:
+ return button_context_usb_hid_mode_mouse;
#endif
#endif
default:
diff --git a/apps/keymaps/keymap-gigabeat-s.c b/apps/keymaps/keymap-gigabeat-s.c
index c959eb09ba..cf150bb6d9 100644
--- a/apps/keymaps/keymap-gigabeat-s.c
+++ b/apps/keymaps/keymap-gigabeat-s.c
@@ -470,49 +470,86 @@ static const struct button_mapping remote_button_context_right_is_inc[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_VOL_UP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_USB_HID_START_LONG, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
- { ACTION_USB_HID_QUIT, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_SELECT, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK },
- { ACTION_USB_HID_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
- { ACTION_USB_HID_MENU_LONG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
- { ACTION_USB_HID_MODE, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_MODE_LONG, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
-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 },
- { ACTION_USB_HID_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
- { ACTION_USB_HID_QUIT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
- { ACTION_USB_HID_LEFT, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
- { ACTION_USB_HID_RIGHT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF},
- { ACTION_USB_HID_SELECT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
- { ACTION_USB_HID_MENU, BUTTON_RC_DSP|BUTTON_REPEAT, BUTTON_RC_DSP },
- { ACTION_USB_HID_MODE, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
- LAST_ITEM_IN_LIST
-}; /* remote_button_context_usb_hid */
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_PREV, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_NEXT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_UP|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_UP|BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+
+ 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_mouse[] = {
+static const struct button_mapping button_context_usb_hid_mode_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 },
@@ -521,22 +558,22 @@ 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, 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_UP, BUTTON_BACK|BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_BACK|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_BACK|BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_BACK|BUTTON_DOWN|BUTTON_REPEAT, 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 },
@@ -553,12 +590,68 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
{ 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_UP, BUTTON_PREV, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_PREV|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 },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_NEXT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
-}; /* button_context_usb_hid_mouse */
+}; /* button_context_usb_hid_mode_mouse */
#endif
+
+static const struct button_mapping remote_button_context_usb_hid[] = {
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_RC_DSP|BUTTON_REPEAT, BUTTON_RC_DSP },
+
+ LAST_ITEM_IN_LIST
+}; /* remote_button_context_usb_hid */
+
+static const struct button_mapping remote_button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* remote_button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping remote_button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* remote_button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping remote_button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_RC_FF|BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_FF|BUTTON_RC_REW },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* remote_button_context_usb_hid_mode_browser */
#endif
static const struct button_mapping* get_context_mapping_remote( int context )
@@ -606,7 +699,14 @@ 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;
+ case CONTEXT_USB_HID_MODE_MULTIMEDIA:
+ return remote_button_context_usb_hid_mode_multimedia;
+ case CONTEXT_USB_HID_MODE_PRESENTATION:
+ return remote_button_context_usb_hid_mode_presentation;
+ case CONTEXT_USB_HID_MODE_BROWSER:
+ return remote_button_context_usb_hid_mode_browser;
#endif
+
default:
return remote_button_context_standard;
}
@@ -677,11 +777,18 @@ 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_MOUSE:
- return button_context_usb_hid_mouse;
+ case CONTEXT_USB_HID_MODE_MOUSE:
+ return button_context_usb_hid_mode_mouse;
#endif
#endif
+
default:
return button_context_standard;
}
diff --git a/apps/keymaps/keymap-h10.c b/apps/keymaps/keymap-h10.c
index 8ee9a28478..9b7800a3da 100644
--- a/apps/keymaps/keymap-h10.c
+++ b/apps/keymaps/keymap-h10.c
@@ -339,73 +339,65 @@ static const struct button_mapping button_context_radio[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_SCROLL_UP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_USB_HID_START_LONG, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
- { ACTION_USB_HID_QUIT, BUTTON_REW|BUTTON_REL, BUTTON_REW },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_FF|BUTTON_REL, BUTTON_FF },
- { ACTION_USB_HID_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_MODE, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
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_SCROLL_UP, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_PLAY|BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_PLAY|BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_PLAY|BUTTON_SCROLL_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 },
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_REW|BUTTON_REL, BUTTON_REW },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_FF|BUTTON_REL, BUTTON_FF },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
-}; /* button_context_usb_hid_mouse */
-#endif
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_REW|BUTTON_REL, BUTTON_REW },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_FF|BUTTON_REL, BUTTON_FF },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_REW|BUTTON_REPEAT, BUTTON_REW },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_FF|BUTTON_REPEAT, BUTTON_FF },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
-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 },
- { ACTION_USB_HID_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
- { ACTION_USB_HID_QUIT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
- { ACTION_USB_HID_LEFT, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
- { ACTION_USB_HID_RIGHT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_REW|BUTTON_REL, BUTTON_REW },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_FF|BUTTON_REL, BUTTON_FF },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_REW|BUTTON_REPEAT, BUTTON_REW },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_FF|BUTTON_REPEAT, BUTTON_FF },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_REW|BUTTON_FF|BUTTON_REPEAT, BUTTON_REW|BUTTON_FF },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_LEFT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_LEFT|BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- LAST_ITEM_IN_LIST
-}; /* remote_button_context_usb_hid */
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_browser */
#endif
static const struct button_mapping* get_context_mapping_remote( int context )
@@ -437,11 +429,6 @@ static const struct button_mapping* get_context_mapping_remote( int context )
return remote_button_context_pitchscreen;
case CONTEXT_RECSCREEN:
return button_context_recscreen;
-#ifdef USB_ENABLE_HID
- case CONTEXT_USB_HID:
- return remote_button_context_usb_hid;
-#endif
-
default:
return remote_button_context_standard;
}
@@ -498,10 +485,6 @@ 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 404d7ecf14..f6f9ab9c8c 100644
--- a/apps/keymaps/keymap-hdd1630.c
+++ b/apps/keymaps/keymap-hdd1630.c
@@ -286,66 +286,116 @@ static const struct button_mapping button_context_radio[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_VOL_UP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
- { ACTION_USB_HID_START_LONG, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
- { ACTION_USB_HID_QUIT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_USB_HID_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_USB_HID_MENU_LONG, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
- { ACTION_USB_HID_MODE, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW },
- { ACTION_USB_HID_MODE_LONG, BUTTON_VIEW|BUTTON_REPEAT, BUTTON_VIEW },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAYLIST|BUTTON_REL, BUTTON_PLAYLIST },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_VIEW|BUTTON_REPEAT, BUTTON_VIEW },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_PLAYLIST|BUTTON_REL, BUTTON_PLAYLIST },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_PLAYLIST|BUTTON_REPEAT, BUTTON_PLAYLIST },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REL, BUTTON_VOL_UP },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_UP },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_VOL_DOWN },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_VOL_DOWN },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_VOL_UP },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_VOL_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_UP },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_VOL_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_PLAYLIST|BUTTON_REPEAT, BUTTON_PLAYLIST },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW },
+
+ 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_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_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 },
+static const struct button_mapping button_context_usb_hid_mode_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_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_LEFT, BUTTON_PLAYLIST, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_PLAYLIST|BUTTON_REL, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_PLAYLIST|BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_PLAYLIST|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_PLAYLIST|BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_PLAYLIST|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_PLAYLIST|BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_PLAYLIST|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_PLAYLIST|BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_PLAYLIST|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_VIEW, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_VIEW|BUTTON_REL, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_VIEW|BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_VIEW|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_VIEW|BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_VIEW|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_VIEW|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 */
+}; /* button_context_usb_hid_mode_mouse */
#endif
#endif
@@ -399,9 +449,15 @@ 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_MOUSE:
- return button_context_usb_hid_mouse;
+ case CONTEXT_USB_HID_MODE_MOUSE:
+ return button_context_usb_hid_mode_mouse;
#endif
#endif
}
diff --git a/apps/keymaps/keymap-ipod.c b/apps/keymaps/keymap-ipod.c
index d0e84ef2dc..1a8f7a25ff 100644
--- a/apps/keymaps/keymap-ipod.c
+++ b/apps/keymaps/keymap-ipod.c
@@ -195,30 +195,70 @@ const struct button_mapping button_context_recscreen[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_SCROLL_FWD, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_SCROLL_BACK, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_USB_HID_QUIT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_USB_HID_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_USB_HID_MENU_LONG, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
- { ACTION_USB_HID_MODE, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REL, BUTTON_SELECT|BUTTON_RIGHT },
- { ACTION_USB_HID_MODE, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_SELECT|BUTTON_RIGHT },
- { ACTION_USB_HID_MODE_LONG, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REL, BUTTON_SELECT|BUTTON_LEFT },
- { ACTION_USB_HID_MODE_LONG, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_SELECT|BUTTON_LEFT },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REL, BUTTON_SELECT|BUTTON_RIGHT },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_SELECT|BUTTON_RIGHT },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REL, BUTTON_SELECT|BUTTON_LEFT },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_SELECT|BUTTON_LEFT },
LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_SCROLL_BACK, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_SCROLL_FWD, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_SCROLL_BACK, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_SCROLL_FWD, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_SCROLL_BACK, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_SCROLL_FWD, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_PLAY|BUTTON_MENU|BUTTON_REPEAT, BUTTON_PLAY|BUTTON_MENU },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_SELECT|BUTTON_MENU|BUTTON_REPEAT, BUTTON_SELECT|BUTTON_MENU },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_SELECT|BUTTON_PLAY|BUTTON_REPEAT, BUTTON_SELECT|BUTTON_PLAY },
+
+ 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_mouse[] = {
+static const struct button_mapping button_context_usb_hid_mode_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 },
@@ -235,7 +275,7 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
{ 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 */
+}; /* button_context_usb_hid_mode_mouse */
#endif
#endif
@@ -271,54 +311,6 @@ static const struct button_mapping remote_button_context_wps[] = {
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* remote_button_context_wps */
-#ifdef USB_ENABLE_HID
-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 },
- { ACTION_USB_HID_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
- { ACTION_USB_HID_QUIT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
- { ACTION_USB_HID_LEFT, BUTTON_RC_LEFT|BUTTON_REL, BUTTON_RC_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_RC_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RC_RIGHT|BUTTON_REL, BUTTON_RC_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_RC_RIGHT },
-
- 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 )
{
context ^= CONTEXT_REMOTE;
@@ -327,16 +319,6 @@ static const struct button_mapping* get_context_mapping_remote( int context )
{
case CONTEXT_WPS:
return remote_button_context_wps;
-#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;
}
@@ -392,9 +374,15 @@ 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_MOUSE:
- return button_context_usb_hid_mouse;
+ case CONTEXT_USB_HID_MODE_MOUSE:
+ return button_context_usb_hid_mode_mouse;
#endif
#endif
default:
diff --git a/apps/keymaps/keymap-mr100.c b/apps/keymaps/keymap-mr100.c
index 79a12428f7..9878b6c330 100644
--- a/apps/keymaps/keymap-mr100.c
+++ b/apps/keymaps/keymap-mr100.c
@@ -317,91 +317,196 @@ static const struct button_mapping remote_button_context_tree[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_UP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_USB_HID_START_LONG, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
- { ACTION_USB_HID_QUIT, BUTTON_DISPLAY|BUTTON_REL, BUTTON_DISPLAY },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_DISPLAY|BUTTON_REPEAT, BUTTON_DISPLAY },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_USB_HID_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_USB_HID_MENU_LONG, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
- { ACTION_USB_HID_MODE, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_MODE_LONG, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
LAST_ITEM_IN_LIST
}; /* 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, BUTTON_MENU|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_MENU|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_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_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_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 },
- { 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 },
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_DISPLAY|BUTTON_REL, BUTTON_DISPLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
-}; /* button_context_usb_hid_mouse */
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_DISPLAY|BUTTON_REL, BUTTON_DISPLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_PLAY|BUTTON_MENU|BUTTON_REPEAT, BUTTON_PLAY|BUTTON_MENU },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_DISPLAY|BUTTON_REPEAT, BUTTON_DISPLAY },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+
+ 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_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_MENU, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_MENU|BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_MENU|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_MENU|BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_MENU|BUTTON_DOWN|BUTTON_REPEAT, 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 },
+ { 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 },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_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 },
- { ACTION_USB_HID_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
- { ACTION_USB_HID_START_LONG, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
- { ACTION_USB_HID_QUIT, BUTTON_RC_DOWN|BUTTON_REL, BUTTON_RC_DOWN },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_RC_DOWN },
- { ACTION_USB_HID_LEFT, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
- { ACTION_USB_HID_RIGHT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
- { ACTION_USB_HID_SELECT, BUTTON_RC_HEART|BUTTON_REL, BUTTON_RC_HEART },
- { ACTION_USB_HID_MENU, BUTTON_RC_HEART|BUTTON_REPEAT, BUTTON_DOWN },
- { ACTION_USB_HID_MODE, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
- { ACTION_USB_HID_MODE_LONG, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_RC_HEART|BUTTON_REL, BUTTON_RC_HEART },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_RC_HEART|BUTTON_REPEAT, BUTTON_RC_HEART },
LAST_ITEM_IN_LIST
}; /* remote_button_context_usb_hid */
+
+static const struct button_mapping remote_button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_RC_DOWN|BUTTON_REL, BUTTON_RC_DOWN },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* remote_button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping remote_button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_RC_DOWN|BUTTON_REL, BUTTON_RC_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_RC_DOWN|BUTTON_REL, BUTTON_RC_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_RC_DOWN },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* remote_button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping remote_button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_RC_DOWN|BUTTON_REL, BUTTON_RC_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_RC_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* remote_button_context_usb_hid_mode_browser */
+
+#ifdef HAVE_USB_HID_MOUSE
+static const struct button_mapping remote_button_context_usb_hid_mode_mouse[] = {
+ { ACTION_USB_HID_MOUSE_UP, BUTTON_RC_PLAY, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_DOWN, BUTTON_RC_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LEFT, BUTTON_RC_REW, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_RC_REW, BUTTON_RC_MODE, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_RC_REW_REL, BUTTON_RC_MODE|BUTTON_REL, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_RC_MODE|BUTTON_RC_PLAY, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_RC_MODE|BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_RC_MODE|BUTTON_RC_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_RC_MODE|BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_RC_MODE|BUTTON_RC_REW, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_RC_MODE|BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_RC_MODE|BUTTON_RC_FF, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_RC_MODE|BUTTON_RC_FF|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_mode_mouse */
+#endif
#endif
static const struct button_mapping* get_context_mapping_remote( int context )
@@ -418,6 +523,16 @@ 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;
+ case CONTEXT_USB_HID_MODE_MULTIMEDIA:
+ return remote_button_context_usb_hid_mode_multimedia;
+ case CONTEXT_USB_HID_MODE_PRESENTATION:
+ return remote_button_context_usb_hid_mode_presentation;
+ case CONTEXT_USB_HID_MODE_BROWSER:
+ return remote_button_context_usb_hid_mode_browser;
+#ifdef HAVE_USB_HID_MOUSE
+ case CONTEXT_USB_HID_MODE_MOUSE:
+ return remote_button_context_usb_hid_mode_mouse;
+#endif
#endif
}
return remote_button_context_standard;
@@ -472,6 +587,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
}
return button_context_standard;
diff --git a/apps/keymaps/keymap-ondavx747.c b/apps/keymaps/keymap-ondavx747.c
index f2d994d190..56a68e519c 100644
--- a/apps/keymaps/keymap-ondavx747.c
+++ b/apps/keymaps/keymap-ondavx747.c
@@ -169,17 +169,48 @@ static const struct button_mapping button_context_keyboard[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_VOL_UP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_QUIT, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
- { ACTION_USB_HID_SELECT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_MENU, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
- { ACTION_USB_HID_MODE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
+
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_VOL_DOWN|BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_DOWN|BUTTON_VOL_UP },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_MENU|BUTTON_LEFT|BUTTON_REL, BUTTON_MENU|BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_MENU|BUTTON_RIGHT|BUTTON_REL, BUTTON_MENU|BUTTON_RIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_VOL_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_VOL_UP|BUTTON_REL, BUTTON_VOL_UP },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_VOL_DOWN },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_UP },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_VOL_DOWN|BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_DOWN|BUTTON_VOL_UP },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_MENU|BUTTON_VOL_UP|BUTTON_REL, BUTTON_MENU|BUTTON_VOL_UP },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_MENU|BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_MENU|BUTTON_VOL_DOWN },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_browser */
#endif
const struct button_mapping* target_get_context_mapping(int context)
@@ -228,9 +259,15 @@ const struct button_mapping* target_get_context_mapping(int context)
return button_context_pitchscreen;
case CONTEXT_KEYBOARD:
return button_context_keyboard;
-#ifdef HAVE_USBSTACK
+#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;
#endif
}
return button_context_standard;
diff --git a/apps/keymaps/keymap-sa9200.c b/apps/keymaps/keymap-sa9200.c
index 1d14a67147..6df9d6c1ed 100644
--- a/apps/keymaps/keymap-sa9200.c
+++ b/apps/keymaps/keymap-sa9200.c
@@ -278,34 +278,72 @@ static const struct button_mapping button_context_keyboard[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_UP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_VOL_UP, BUTTON_NONE },
- { ACTION_USB_HID_INC, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_DEC, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_USB_HID_START_LONG, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
- { ACTION_USB_HID_QUIT, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV },
- { ACTION_USB_HID_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT },
- { ACTION_USB_HID_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_USB_HID_MENU_LONG, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
- { ACTION_USB_HID_MODE, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_MODE_LONG, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_UP|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_UP|BUTTON_DOWN },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_LEFT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_LEFT|BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
+
+ 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_mouse[] = {
+static const struct button_mapping button_context_usb_hid_mode_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 },
@@ -340,7 +378,7 @@ static const struct button_mapping button_context_usb_hid_mouse[] = {
{ 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 */
+}; /* button_context_usb_hid_mode_mouse */
#endif
#endif
@@ -390,13 +428,18 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_KEYBOARD:
return button_context_keyboard;
-
#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_MOUSE:
- return button_context_usb_hid_mouse;
+ case CONTEXT_USB_HID_MODE_MOUSE:
+ return button_context_usb_hid_mode_mouse;
#endif
#endif
}
diff --git a/apps/keymaps/keymap-touchscreen.c b/apps/keymaps/keymap-touchscreen.c
index 499eb2b562..74673ccb20 100644
--- a/apps/keymaps/keymap-touchscreen.c
+++ b/apps/keymaps/keymap-touchscreen.c
@@ -253,27 +253,63 @@ static const struct button_mapping button_context_radio[] = {
#ifdef USB_ENABLE_HID
static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_INC, BUTTON_BOTTOMRIGHT|BUTTON_REL, BUTTON_BOTTOMRIGHT },
- { ACTION_USB_HID_INC, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT },
- { ACTION_USB_HID_DEC, BUTTON_BOTTOMMIDDLE|BUTTON_REL, BUTTON_BOTTOMMIDDLE },
- { ACTION_USB_HID_DEC, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_BOTTOMMIDDLE },
- { ACTION_USB_HID_START, BUTTON_TOPMIDDLE|BUTTON_REL, BUTTON_TOPMIDDLE },
- { ACTION_USB_HID_START_LONG, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_TOPMIDDLE },
- { ACTION_USB_HID_QUIT, BUTTON_BOTTOMLEFT|BUTTON_REL, BUTTON_BOTTOMLEFT },
- { ACTION_USB_HID_QUIT_LONG, BUTTON_BOTTOMLEFT|BUTTON_REPEAT, BUTTON_BOTTOMLEFT },
- { ACTION_USB_HID_LEFT, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_MIDLEFT },
- { ACTION_USB_HID_LEFT_LONG, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_MIDLEFT },
- { ACTION_USB_HID_RIGHT, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT },
- { ACTION_USB_HID_RIGHT_LONG, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_MIDRIGHT },
- { ACTION_USB_HID_SELECT, BUTTON_CENTER|BUTTON_REL, BUTTON_CENTER },
- { ACTION_USB_HID_SELECT_LONG, BUTTON_CENTER|BUTTON_REPEAT, BUTTON_CENTER },
- { ACTION_USB_HID_MENU, BUTTON_TOPRIGHT|BUTTON_REL, BUTTON_TOPRIGHT },
- { ACTION_USB_HID_MENU_LONG, BUTTON_TOPRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT },
- { ACTION_USB_HID_MODE, BUTTON_TOPLEFT|BUTTON_REL, BUTTON_TOPLEFT },
- { ACTION_USB_HID_MODE_LONG, BUTTON_TOPLEFT|BUTTON_REPEAT, BUTTON_TOPLEFT },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_USB_HID)
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_TOPLEFT|BUTTON_REL, BUTTON_TOPLEFT },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_TOPLEFT|BUTTON_REPEAT, BUTTON_TOPLEFT },
+
+ LAST_ITEM_IN_LIST
}; /* button_context_usb_hid */
+
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_BOTTOMMIDDLE, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_TOPMIDDLE, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_CENTER|BUTTON_REL, BUTTON_CENTER },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_TOPRIGHT|BUTTON_REL, BUTTON_TOPRIGHT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_TOPRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_BOTTOMLEFT|BUTTON_REL, BUTTON_BOTTOMLEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_BOTTOMRIGHT|BUTTON_REL, BUTTON_BOTTOMRIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_TOPRIGHT|BUTTON_REL, BUTTON_TOPRIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_TOPRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_MIDLEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_MIDLEFT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_MIDRIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_BOTTOMRIGHT|BUTTON_REL, BUTTON_BOTTOMRIGHT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_TOPMIDDLE|BUTTON_REL, BUTTON_TOPMIDDLE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_TOPMIDDLE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_BOTTOMMIDDLE|BUTTON_REL, BUTTON_BOTTOMMIDDLE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_BOTTOMMIDDLE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_CENTER|BUTTON_REL, BUTTON_CENTER },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_CENTER|BUTTON_REPEAT, BUTTON_CENTER },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_TOPMIDDLE, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_BOTTOMMIDDLE, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_TOPRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_CENTER|BUTTON_REPEAT, BUTTON_CENTER },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_TOPRIGHT|BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT|BUTTON_BOTTOMRIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_MIDLEFT },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_BOTTOMLEFT|BUTTON_REPEAT, BUTTON_BOTTOMLEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_MIDLEFT },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_MIDRIGHT },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_CENTER|BUTTON_REL, BUTTON_CENTER },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_browser */
#endif
const struct button_mapping* get_context_mapping(int context)
@@ -331,7 +367,14 @@ 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;
#endif
+
}
return button_context_standard;
}
diff --git a/apps/screens.c b/apps/screens.c
index 3917f31a96..eb34103a4a 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -115,8 +115,8 @@ static int handle_usb_events(void)
button = get_hid_usb_action();
/* On mode change, we need to refresh the screen */
- if (button == ACTION_USB_HID_MODE ||
- button == ACTION_USB_HID_MODE_LONG)
+ if (button == ACTION_USB_HID_MODE_SWITCH_NEXT ||
+ button == ACTION_USB_HID_MODE_SWITCH_PREV)
{
break;
}
diff --git a/apps/usb_keymaps.c b/apps/usb_keymaps.c
index 41387a1005..f787de692f 100644
--- a/apps/usb_keymaps.c
+++ b/apps/usb_keymaps.c
@@ -45,94 +45,66 @@ typedef struct
typedef struct
{
int lang_name;
+ int context;
usage_page_t usage_page;
mapping_t mapping[];
} hid_key_mapping_t;
static const hid_key_mapping_t hid_key_mapping_multimedia = {
LANG_MULTIMEDIA_MODE,
+ CONTEXT_USB_HID_MODE_MULTIMEDIA,
HID_USAGE_PAGE_CONSUMER,
{
- /* Volume up */
- { ACTION_USB_HID_DEC, HID_CONSUMER_USAGE_VOLUME_DECREMENT },
- /* Volume down */
- { ACTION_USB_HID_INC, HID_CONSUMER_USAGE_VOLUME_INCREMENT },
- /* Volume mute */
- { ACTION_USB_HID_SELECT, HID_CONSUMER_USAGE_MUTE },
- /* Playback play / pause */
- { ACTION_USB_HID_START, HID_CONSUMER_USAGE_PLAY_PAUSE },
- /* Playback stop */
- { ACTION_USB_HID_QUIT, HID_CONSUMER_USAGE_STOP },
- /* Scan previous track */
- { ACTION_USB_HID_LEFT, HID_CONSUMER_USAGE_SCAN_PREVIOUS_TRACK },
- /* Scan next track */
- { ACTION_USB_HID_RIGHT, HID_CONSUMER_USAGE_SCAN_NEXT_TRACK },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, HID_CONSUMER_USAGE_VOLUME_INCREMENT },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, HID_CONSUMER_USAGE_VOLUME_DECREMENT },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, HID_CONSUMER_USAGE_MUTE },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, HID_CONSUMER_USAGE_PLAY_PAUSE },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, HID_CONSUMER_USAGE_STOP },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, HID_CONSUMER_USAGE_SCAN_PREVIOUS_TRACK },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, HID_CONSUMER_USAGE_SCAN_NEXT_TRACK },
{ 0, 0 },
}
};
static const hid_key_mapping_t hid_key_mapping_presentation = {
LANG_PRESENTATION_MODE,
+ CONTEXT_USB_HID_MODE_PRESENTATION,
HID_USAGE_PAGE_KEYBOARD_KEYPAD,
{
- /* Slideshow start */
- { ACTION_USB_HID_START, HID_KEYBOARD_F5 },
- /* Slideshow leave */
- { ACTION_USB_HID_QUIT, HID_KEYBOARD_ESCAPE },
- /* Slide previous */
- { ACTION_USB_HID_LEFT, HID_KEYBOARD_P },
- /* Slide next */
- { ACTION_USB_HID_RIGHT, HID_KEYBOARD_N },
- /* Slide first */
- { ACTION_USB_HID_LEFT_LONG, HID_KEYBOARD_HOME },
- /* Slide last */
- { ACTION_USB_HID_RIGHT_LONG, HID_KEYBOARD_END },
- /* Screen black */
- { ACTION_USB_HID_MENU, HID_KEYBOARD_DOT },
- /* Screen white*/
- { ACTION_USB_HID_MENU_LONG, HID_KEYBOARD_COMMA },
- /* Link previous */
- { ACTION_USB_HID_DEC, SHIFT(HID_KEYBOARD_TAB) },
- /* Link next */
- { ACTION_USB_HID_INC, HID_KEYBOARD_TAB },
- /* Mouse click */
- { ACTION_USB_HID_SELECT, HID_KEYBOARD_RETURN },
- /* Mouse over */
- { ACTION_USB_HID_SELECT_LONG, SHIFT(HID_KEYBOARD_RETURN) },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, HID_KEYBOARD_F5 },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, HID_KEYBOARD_ESCAPE },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, HID_KEYBOARD_P },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, HID_KEYBOARD_N },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, HID_KEYBOARD_HOME },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, HID_KEYBOARD_END },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, HID_KEYBOARD_DOT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, HID_KEYBOARD_COMMA },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, SHIFT(HID_KEYBOARD_TAB) },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, HID_KEYBOARD_TAB },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, HID_KEYBOARD_RETURN },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, SHIFT(HID_KEYBOARD_RETURN) },
{ 0, 0 },
}
};
static const hid_key_mapping_t hid_key_mapping_browser = {
LANG_BROWSER_MODE,
+ CONTEXT_USB_HID_MODE_BROWSER,
HID_USAGE_PAGE_KEYBOARD_KEYPAD,
{
- /* Scroll up */
- { ACTION_USB_HID_DEC, HID_KEYBOARD_UP_ARROW },
- /* Scroll down */
- { ACTION_USB_HID_INC, HID_KEYBOARD_DOWN_ARROW },
- /* Scroll page up */
- { ACTION_USB_HID_START, HID_KEYBOARD_PAGE_UP },
- /* Scroll page down */
- { ACTION_USB_HID_MENU, HID_KEYBOARD_PAGE_DOWN },
- /* Zoom in */
- { ACTION_USB_HID_START_LONG, CTRL(HID_KEYPAD_PLUS) },
- /* Zoom out */
- { ACTION_USB_HID_MENU_LONG, CTRL(HID_KEYPAD_MINUS) },
- /* Zoom reset */
- { ACTION_USB_HID_SELECT_LONG, CTRL(HID_KEYPAD_0_AND_INSERT) },
- /* Tab previous */
- { ACTION_USB_HID_LEFT, CTRL(HID_KEYBOARD_PAGE_UP) },
- /* Tab next */
- { ACTION_USB_HID_RIGHT, CTRL(HID_KEYBOARD_PAGE_DOWN) },
- /* Tab close */
- { ACTION_USB_HID_QUIT_LONG, CTRL(HID_KEYBOARD_W) },
- /* History back */
- { ACTION_USB_HID_LEFT_LONG, ALT(HID_KEYBOARD_LEFT_ARROW) },
- /* History forward */
- { ACTION_USB_HID_RIGHT_LONG, ALT(HID_KEYBOARD_RIGHT_ARROW) },
- /* View full-screen */
- { ACTION_USB_HID_SELECT, HID_KEYBOARD_F11 },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, HID_KEYBOARD_UP_ARROW },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, HID_KEYBOARD_DOWN_ARROW },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, HID_KEYBOARD_PAGE_UP },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, HID_KEYBOARD_PAGE_DOWN },
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, CTRL(HID_KEYPAD_PLUS) },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, CTRL(HID_KEYPAD_MINUS) },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, CTRL(HID_KEYPAD_0_AND_INSERT) },
+ { ACTION_USB_HID_BROWSER_TAB_PREV, CTRL(HID_KEYBOARD_PAGE_UP) },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, CTRL(HID_KEYBOARD_PAGE_DOWN) },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, CTRL(HID_KEYBOARD_W) },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, ALT(HID_KEYBOARD_LEFT_ARROW) },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, ALT(HID_KEYBOARD_RIGHT_ARROW) },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, HID_KEYBOARD_F11 },
{ 0, 0 },
}
};
@@ -140,6 +112,7 @@ static const hid_key_mapping_t hid_key_mapping_browser = {
#ifdef HAVE_USB_HID_MOUSE
static const hid_key_mapping_t hid_key_mapping_mouse = {
LANG_MOUSE_MODE,
+ CONTEXT_USB_HID_MODE_MOUSE,
HID_USAGE_PAGE_GENERIC_DESKTOP_CONTROLS,
{
/* Cursor move up */
@@ -201,21 +174,19 @@ extern int usb_keypad_mode;
int get_hid_usb_action(void)
{
- int action, context = CONTEXT_USB_HID;
-
-#ifdef HAVE_USB_HID_MOUSE
- if (usb_keypad_mode == USB_KEYPAD_MODE_MOUSE)
- context = CONTEXT_USB_HID_MOUSE;
-#endif
+ int action;
+ const hid_key_mapping_t *key_mapping = hid_key_mappings[usb_keypad_mode];
- action = get_action(context, HZ/4);
+ action = get_action(key_mapping->context, HZ/4);
/* Skip key mappings in a cyclic way */
- if (action == ACTION_USB_HID_MODE)
+ if (action == ACTION_USB_HID_MODE_SWITCH_NEXT)
{
+ /* TODO: Use clamp_value_wrap() */
usb_keypad_mode = (usb_keypad_mode + 1) % NUM_KEY_MAPPINGS;
}
- else if (action == ACTION_USB_HID_MODE_LONG)
+ else if (action == ACTION_USB_HID_MODE_SWITCH_PREV)
{
+ /* TODO: Use clamp_value_wrap() */
usb_keypad_mode = (usb_keypad_mode - 1) % NUM_KEY_MAPPINGS;
}
else if (action > ACTION_USB_HID_FIRST && action < ACTION_USB_HID_LAST)