From 4f3d7b5bcb0b025332e128c3856aa9d4cce91898 Mon Sep 17 00:00:00 2001 From: Tomer Shalev Date: Sat, 17 Oct 2009 05:39:54 +0000 Subject: [PATCH] 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 --- apps/action.h | 56 ++-- apps/keymaps/keymap-c100.c | 90 +++++-- apps/keymaps/keymap-c200.c | 88 +++++-- apps/keymaps/keymap-clip.c | 88 +++++-- apps/keymaps/keymap-e200.c | 88 +++++-- apps/keymaps/keymap-gigabeat-s.c | 201 ++++++++++---- apps/keymaps/keymap-h10.c | 119 ++++----- apps/keymaps/keymap-hdd1630.c | 164 ++++++++---- apps/keymaps/keymap-ipod.c | 148 +++++------ apps/keymaps/keymap-mr100.c | 273 ++++++++++++++------ apps/keymaps/keymap-ondavx747.c | 55 +++- apps/keymaps/keymap-sa9200.c | 97 +++++-- apps/keymaps/keymap-touchscreen.c | 81 ++++-- apps/screens.c | 4 +- apps/usb_keymaps.c | 117 ++++----- firmware/export/config-h10.h | 1 - firmware/export/config-h10_5gb.h | 1 - firmware/export/config-mrobe100.h | 1 + manual/configure_rockbox/system_options.tex | 264 ++++++++++++------- 19 files changed, 1282 insertions(+), 654 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_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_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_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 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 }, +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 }, - LAST_ITEM_IN_LIST -}; /* remote_button_context_usb_hid */ + 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__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 }, + { 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__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_USB_HID) + 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; + int action; + const hid_key_mapping_t *key_mapping = hid_key_mappings[usb_keypad_mode]; -#ifdef HAVE_USB_HID_MOUSE - if (usb_keypad_mode == USB_KEYPAD_MODE_MOUSE) - context = CONTEXT_USB_HID_MOUSE; -#endif - - 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) diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h index 5ac12af3fc..0dc845c23b 100644 --- a/firmware/export/config-h10.h +++ b/firmware/export/config-h10.h @@ -173,7 +173,6 @@ #define USE_ROCKBOX_USB #define USB_VENDOR_ID 0x0B70 #define USB_PRODUCT_ID 0x00BA -#define HAVE_USB_HID_MOUSE /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h index e39c6a6bbf..8275e50dc6 100644 --- a/firmware/export/config-h10_5gb.h +++ b/firmware/export/config-h10_5gb.h @@ -153,7 +153,6 @@ #define USE_ROCKBOX_USB #define USB_VENDOR_ID 0x0B70 #define USB_PRODUCT_ID 0x00BA -#define HAVE_USB_HID_MOUSE /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ diff --git a/firmware/export/config-mrobe100.h b/firmware/export/config-mrobe100.h index 4fdea149ae..c348770188 100644 --- a/firmware/export/config-mrobe100.h +++ b/firmware/export/config-mrobe100.h @@ -178,6 +178,7 @@ #define USE_ROCKBOX_USB #define USB_VENDOR_ID 0x07B4 #define USB_PRODUCT_ID 0x0280 +#define HAVE_USB_HID_MOUSE /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ diff --git a/manual/configure_rockbox/system_options.tex b/manual/configure_rockbox/system_options.tex index 854fadaf0f..5ff5dd05b9 100644 --- a/manual/configure_rockbox/system_options.tex +++ b/manual/configure_rockbox/system_options.tex @@ -190,28 +190,23 @@ this option \setting{On}. If it is not required, then turning this setting keypad mode. There are different modes which provide different functionality. \opt{SANSA_E200_PAD,GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% - ,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD}{% + ,IRIVER_H10_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD}{% Switching modes back and forth is done by pressing the - \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec} % - \opt{GIGABEAT_S_PAD,SANSA_CLIP_PAD,MROBE100_PAD}{\ButtonPower} % - \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}{\ButtonSelect+\ButtonRight} % - and % - \opt{SANSA_E200_PAD,SANSA_C200_PAD}{Long \ButtonRec} % - \opt{GIGABEAT_S_PAD,SANSA_CLIP_PAD,MROBE100_PAD}{Long \ButtonPower} % - \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}{\ButtonSelect+\ButtonLeft} % - keys, respectively.% - }% - \opt{IRIVER_H10_PAD}{% - Switching modes is done by pressing the - \opt{IRIVER_H10_PAD}{Long \ButtonPower} % - key.% + \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}% + \opt{GIGABEAT_S_PAD,SANSA_CLIP_PAD,MROBE100_PAD,IRIVER_H10_PAD}% + {\ButtonPower}% + \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}{\ButtonSelect+\ButtonRight}% + { }and % + \opt{SANSA_E200_PAD,SANSA_C200_PAD}{Long \ButtonRec}% + \opt{GIGABEAT_S_PAD,SANSA_CLIP_PAD,MROBE100_PAD,IRIVER_H10_PAD}% + {Long \ButtonPower}% + \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}{\ButtonSelect+\ButtonLeft}% + { }keys, respectively.% }% \opt{HAVEREMOTEKEYMAP}{ Remote % - \opt{GIGABEAT_S_PAD}{\ButtonRCDsp} % - % XXX: mr100 doesn't have manual/platform/remote-keymap-mrobe100.tex - \opt{MROBE100_PAD}{\btnfnt{Mode} and Long \btnfnt{Mode}} % - can also be used to switch modes.% + \opt{GIGABEAT_RC_PAD}{\ButtonRCDsp / Long \ButtonRCDsp}% + { }can also be used to switch modes.% }% \newline\newline The following modes are available: @@ -225,7 +220,7 @@ this option \setting{On}. If it is not required, then turning this setting % % Volume up / down \opt{SANSA_E200_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} - {\ButtonScrollBack / \ButtonScrollFwd} + {\ButtonScrollFwd / \ButtonScrollBack} \opt{GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD} {\ButtonVolUp / \ButtonVolDown} \opt{IRIVER_H10_PAD}{\ButtonScrollUp / \ButtonScrollDown} @@ -238,8 +233,7 @@ this option \setting{On}. If it is not required, then turning this setting % % Volume mute \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD% - ,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} - {\ButtonSelect} + ,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD}{\ButtonSelect} \opt{GIGABEAT_S_PAD}{\ButtonSelect; \ButtonBack} \opt{IRIVER_H10_PAD}{\ButtonFF} \opt{HAVEREMOTEKEYMAP}{ @@ -250,9 +244,9 @@ this option \setting{On}. If it is not required, then turning this setting % % Playback play / pause \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonUp} - \opt{GIGABEAT_S_PAD,IRIVER_H10_PAD,IPOD_4G_PAD,IPOD_3G_PAD% - ,IPOD_1G2G_PAD,MROBE100_PAD} - {\ButtonPlay} + \opt{IRIVER_H10_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD% + ,MROBE100_PAD}{\ButtonPlay} + \opt{GIGABEAT_S_PAD}{\ButtonPlay; \ButtonUp} \opt{HAVEREMOTEKEYMAP}{ & \opt{GIGABEAT_RC_PAD}{\ButtonRCPlay}% @@ -261,27 +255,38 @@ this option \setting{On}. If it is not required, then turning this setting % % Playback stop \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonPower} - \opt{GIGABEAT_S_PAD}{\ButtonMenu} + \opt{GIGABEAT_S_PAD}{\ButtonMenu; \ButtonDown} \opt{SANSA_CLIP_PAD}{\ButtonHome} - \opt{IRIVER_H10_PAD}{\ButtonRew} - \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}{Long \ButtonPlay} - \opt{MROBE100_PAD}{\ButtonDisplay} + \opt{IRIVER_H10_PAD}{\ButtonRew; Long \ButtonPlay} + \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} + {\ButtonMenu; Long \ButtonPlay} + \opt{MROBE100_PAD}{\ButtonDisplay; Long {\ButtonPlay}} \opt{HAVEREMOTEKEYMAP}{ & \opt{GIGABEAT_RC_PAD}{Long \ButtonRCPlay}% } & Stop \\ % - % Scan previous / next track - \opt{SANSA_E200_PAD,GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% - ,IRIVER_H10_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD% - ,MROBE100_PAD} - {\ButtonLeft / \ButtonRight} + % Scan previous track + \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IRIVER_H10_PAD% + ,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} + {\ButtonLeft} + \opt{GIGABEAT_RC_PAD}{\ButtonPrev; \ButtonLeft}% \opt{HAVEREMOTEKEYMAP}{ & - \opt{GIGABEAT_RC_PAD}{\ButtonRCRew / \ButtonRCFF}% } - & Scan previous / next track \\ + & Scan previous track \\ + % + % Scan next track + \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IRIVER_H10_PAD% + ,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} + {\ButtonRight} + \opt{GIGABEAT_RC_PAD}{\ButtonNext; \ButtonRight}% + \opt{HAVEREMOTEKEYMAP}{ + & + \opt{GIGABEAT_RC_PAD}{\ButtonRCFF}% + } + & Scan next track \\ \end{btnmap} \end{table} @@ -293,51 +298,92 @@ this option \setting{On}. If it is not required, then turning this setting \begin{table} \begin{btnmap}{}{} % - % Slideshow start / leave - \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonUp / \ButtonPower} - \opt{GIGABEAT_S_PADIRIVER_H10_PAD}{\ButtonPlay / \ButtonMenu} - \opt{SANSA_CLIP_PAD}{\ButtonUp / \ButtonHome} - \opt{IRIVER_H10_PAD}{\ButtonPlay / \ButtonRew} - \opt{GIGABEAT_S_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} - {\ButtonPlay / Long \ButtonPlay} - \opt{MROBE100_PAD}{\ButtonPlay / \ButtonDisplay} + % Slideshow start + \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonUp} + \opt{GIGABEAT_S_PAD}{\ButtonPlay; \ButtonUp} + \opt{IRIVER_H10_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD% + ,MROBE100_PAD}{\ButtonPlay} \opt{HAVEREMOTEKEYMAP}{ & - \opt{GIGABEAT_RC_PAD}{\ButtonRCPlay / Long \ButtonRCPlay}% + \opt{GIGABEAT_RC_PAD}{\ButtonRCPlay}% } - & Slideshow start / leave, respectively \\ + & Slideshow start \\ % - % Slide previous / next - \opt{SANSA_E200_PAD,GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% - ,IRIVER_H10_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} - {\ButtonLeft / \ButtonRight} + % Slideshow leave + \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonPower} + \opt{GIGABEAT_S_PAD}{Long \ButtonPlay; Long \ButtonUp} + \opt{SANSA_CLIP_PAD}{\ButtonHome} + \opt{IRIVER_H10_PAD}{Long \ButtonPlay} + \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}{Long \ButtonPlay} + \opt{MROBE100_PAD}{\ButtonDisplay; Long \ButtonPlay} \opt{HAVEREMOTEKEYMAP}{ & - \opt{GIGABEAT_RC_PAD}{\ButtonRCRew / \ButtonRCFF}% + \opt{GIGABEAT_RC_PAD}{Long \ButtonRCPlay}% } - & Slide previous / next, respectively \\ + & Slideshow leave \\ % - % Slide first / last - \opt{SANSA_E200_PAD,GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% - ,IRIVER_H10_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} - {Long \ButtonLeft / Long \ButtonRight} - \opt{HAVEREMOTEKEYMAP}{& } - & Slide first / last, respectively \\ + % Slide previous + \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD% + ,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD}{\ButtonLeft} + \opt{GIGABEAT_S_PAD}{\ButtonPrev; \ButtonLeft} + \opt{IRIVER_H10_PAD}{\ButtonRew} + \opt{HAVEREMOTEKEYMAP}{ + & + \opt{GIGABEAT_RC_PAD}{\ButtonRCRew}% + } + & Slide previous \\ + % + % Slide next + \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD% + ,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD}{\ButtonRight} + \opt{GIGABEAT_S_PAD}{\ButtonNext; \ButtonRight} + \opt{IRIVER_H10_PAD}{\ButtonFF} + \opt{HAVEREMOTEKEYMAP}{ + & + \opt{GIGABEAT_RC_PAD}{\ButtonRCFF}% + } + & Slide next \\ + % + % Slide first + \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD% + ,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD}{Long \ButtonLeft} + \opt{GIGABEAT_S_PAD}{Long \ButtonPrev; Long \ButtonLeft} + \opt{IRIVER_H10_PAD}{Long \ButtonRew} + \opt{HAVEREMOTEKEYMAP}{ + & + } + & Slide first \\ + % + % Slide last + \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD% + ,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD}{Long \ButtonRight} + \opt{GIGABEAT_S_PAD}{Long \ButtonNext; Long \ButtonRight} + \opt{IRIVER_H10_PAD}{Long \ButtonFF} + \opt{HAVEREMOTEKEYMAP}{ + & + } + & Slide last \\ % % Screen black \opt{SANSA_E200_PAD,GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD} {\ButtonDown} - \opt{IRIVER_H10_PAD}{\ButtonPower} - \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD}{\ButtonMenu} - \opt{HAVEREMOTEKEYMAP}{& } + \opt{IRIVER_H10_PAD}{\ButtonLeft} + \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} + {\ButtonMenu} + \opt{HAVEREMOTEKEYMAP}{ + & + } & Blank screen \\ % % Screen white \opt{SANSA_E200_PAD,GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD} {Long \ButtonDown} + \opt{IRIVER_H10_PAD}{Long \ButtonLeft} \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} {Long \ButtonMenu} - \opt{HAVEREMOTEKEYMAP}{& } + \opt{HAVEREMOTEKEYMAP}{ + & + } & White screen \\ % % Link previous / next @@ -358,7 +404,7 @@ this option \setting{On}. If it is not required, then turning this setting ,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} {\ButtonSelect} \opt{GIGABEAT_S_PAD}{\ButtonSelect; \ButtonBack} - \opt{IRIVER_H10_PAD}{\ButtonFF} + \opt{IRIVER_H10_PAD}{\ButtonRight} \opt{HAVEREMOTEKEYMAP}{ & \opt{GIGABEAT_RC_PAD}{Long \ButtonRCFF}% @@ -370,6 +416,7 @@ this option \setting{On}. If it is not required, then turning this setting ,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} {Long \ButtonSelect} \opt{GIGABEAT_S_PAD}{Long \ButtonSelect; Long \ButtonBack} + \opt{IRIVER_H10_PAD}{Long \ButtonRight} \opt{HAVEREMOTEKEYMAP}{ & \opt{GIGABEAT_RC_PAD}{Long \ButtonRCRew}% @@ -387,8 +434,9 @@ this option \setting{On}. If it is not required, then turning this setting % Scroll up / down \opt{SANSA_E200_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} {\ButtonScrollBack / \ButtonScrollFwd} - \opt{GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD} - {\ButtonVolUp / \ButtonVolDown} + \opt{SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonVolUp / \ButtonVolDown} + \opt{GIGABEAT_S_PAD} + {\ButtonPrev; \ButtonVolUp / \ButtonNext; \ButtonVolDown} \opt{IRIVER_H10_PAD}{\ButtonScrollUp / \ButtonScrollDown} \opt{MROBE100_PAD}{\ButtonUp / \ButtonDown} \opt{HAVEREMOTEKEYMAP}{ @@ -400,48 +448,66 @@ this option \setting{On}. If it is not required, then turning this setting % Scroll page up / page down \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD} {\ButtonUp / \ButtonDown} - \opt{GIGABEAT_S_PAD}{\ButtonPlay / \ButtonDown} - \opt{IRIVER_H10_PAD}{\ButtonPlay / \ButtonPower} + \opt{GIGABEAT_S_PAD}{\ButtonUp / \ButtonDown} + \opt{IRIVER_H10_PAD}{\ButtonRew / \ButtonFF} \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} {\ButtonPlay / \ButtonMenu} \opt{HAVEREMOTEKEYMAP}{ & - \opt{GIGABEAT_RC_PAD}{\ButtonRCPlay / Long \ButtonRCDsp}% } & Scroll page up / page down, respectively \\ % % Zoom in / out \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD} {Long \ButtonUp / Long \ButtonDown} - \opt{GIGABEAT_S_PAD}{Long \ButtonPlay / Long \ButtonPower} - \opt{MROBE100_PAD}{Long \ButtonPlay / Long \ButtonMenu} - \opt{HAVEREMOTEKEYMAP}{& } + \opt{GIGABEAT_S_PAD}{Long \ButtonUp / Long \ButtonDown} + \opt{IRIVER_H10_PAD}{Long \ButtonRew / Long \ButtonFF} + \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} + {Long \ButtonPlay / Long \ButtonMenu} + \opt{HAVEREMOTEKEYMAP}{ + & + \opt{GIGABEAT_RC_PAD}{Long \ButtonRCFF / Long \ButtonRCRew}% + } & Zoom in / out, respectively \\ % % Zoom reset - \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD} - {Long \ButtonSelect} - \opt{GIGABEAT_S_PAD}{Long \ButtonSelect; Long \ButtonBack} + \opt{SANSA_E200_PAD}{Long \ButtonSelect; Long \ButtonUp+\ButtonDown} + \opt{MROBE100_PAD}{Long \ButtonSelect; Long \ButtonPlay+\ButtonMenu} + \opt{SANSA_CLIP_PAD,SANSA_C200_PAD} + {Long \ButtonSelect; Long \ButtonUp+\ButtonDown} + \opt{GIGABEAT_S_PAD}{Long \ButtonSelect; Long \ButtonUp+\ButtonDown} + \opt{IRIVER_H10_PAD}{Long \ButtonRew+\ButtonFF} + \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} + {Long \ButtonPlay+\ButtonMenu} \opt{HAVEREMOTEKEYMAP}{ & - \opt{GIGABEAT_RC_PAD}{Long \ButtonRCRew}% + \opt{GIGABEAT_RC_PAD}{Long \ButtonRCFF+\ButtonRCRew}% } & Zoom reset \\ % % Tab previous / next \opt{SANSA_E200_PAD,GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% - ,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} + ,IRIVER_H10_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD% + ,MROBE100_PAD} {\ButtonLeft / \ButtonRight} - \opt{IRIVER_H10_PAD}{\ButtonRew / \ButtonFF} - \opt{HAVEREMOTEKEYMAP}{& } + \opt{HAVEREMOTEKEYMAP}{ + & + \opt{GIGABEAT_RC_PAD}{\ButtonRCRew / \ButtonRCFF}% + } & Tab previous / next, respectively \\ % % Tab close \opt{SANSA_E200_PAD,SANSA_C200_PAD}{Long \ButtonPower} - \opt{GIGABEAT_S_PAD}{Long \ButtonMenu} + \opt{GIGABEAT_S_PAD}{Long \ButtonPlay; Long \ButtonBack} \opt{SANSA_CLIP_PAD}{Long \ButtonHome} + \opt{IRIVER_H10_PAD}{Long \ButtonLeft+\ButtonRight} \opt{MROBE100_PAD}{Long \ButtonDisplay} - \opt{HAVEREMOTEKEYMAP}{& } + \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} + {Long \ButtonSelect+\ButtonMenu} + \opt{HAVEREMOTEKEYMAP}{ + & + \opt{GIGABEAT_RC_PAD}{Long \ButtonRCPlay}% + } & Tab close \\ % % History back / forward @@ -450,19 +516,19 @@ this option \setting{On}. If it is not required, then turning this setting {Long \ButtonLeft / Long \ButtonRight} \opt{HAVEREMOTEKEYMAP}{ & - \opt{GIGABEAT_RC_PAD}{\ButtonRCRew / \ButtonRCFF}% } & History back / forward \\ % % View full-screen - \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD% - ,IPOD_3G_PAD,IPOD_1G2G_PAD,MROBE100_PAD} + \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_S_PAD% + ,MROBE100_PAD} {\ButtonSelect} - \opt{GIGABEAT_S_PAD}{Long \ButtonSelect; Long \ButtonBack} - \opt{IRIVER_H10_PAD}{\ButtonFF} + \opt{IRIVER_H10_PAD}{\ButtonPlay} + \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} + {Long \ButtonSelect+\ButtonPlay} \opt{HAVEREMOTEKEYMAP}{ & - \opt{GIGABEAT_RC_PAD}{Long \ButtonRCRew}% + \opt{GIGABEAT_RC_PAD}{\ButtonRCPlay}% } & View full-screen toggle \\ \end{btnmap} @@ -480,9 +546,9 @@ this option \setting{On}. If it is not required, then turning this setting {\ButtonUp / \ButtonDown / \ButtonLeft / \ButtonRight} \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} {\ButtonMenu / \ButtonPlay / \ButtonLeft / \ButtonRight} - \opt{IRIVER_H10_PAD} - {\ButtonScrollUp / \ButtonScrollDown / \ButtonLeft / \ButtonRight} - \opt{HAVEREMOTEKEYMAP}{& } + \opt{HAVEREMOTEKEYMAP}{ + & + } & Cursor move up / down / left / right, respectively \\ % % Mouse button left-click @@ -490,25 +556,31 @@ this option \setting{On}. If it is not required, then turning this setting ,IPOD_3G_PAD,IPOD_1G2G_PAD} {\ButtonSelect} \opt{GIGABEAT_S_PAD}{\ButtonSelect; \ButtonBack} - \opt{MROBE100_PAD}{\ButtonSelect; \ButtonMenu} - \opt{IRIVER_H10_PAD}{\ButtonPower} - \opt{HAVEREMOTEKEYMAP}{& } + \opt{MROBE100_PAD}{\ButtonMenu} + \opt{HAVEREMOTEKEYMAP}{ + & + } & Left mouse button click \\ % % Mouse button right-click \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonPower} \opt{GIGABEAT_S_PAD}{\ButtonMenu} \opt{SANSA_CLIP_PAD}{\ButtonHome} - \opt{MROBE100_PAD,IRIVER_H10_PAD}{\ButtonPlay} - \opt{HAVEREMOTEKEYMAP}{& } + \opt{MROBE100_PAD}{\ButtonPlay} + \opt{HAVEREMOTEKEYMAP}{ + & + } & Right mouse button click \\ % Mouse wheel scroll up / down \opt{SANSA_E200_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD} {\ButtonScrollBack / \ButtonScrollFwd} - \opt{GIGABEAT_S_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD} + \opt{GIGABEAT_S_PAD} + {\ButtonVolUp; \ButtonPrev / \ButtonVolDown; \ButtonNext} + \opt{SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD} {\ButtonVolUp / \ButtonVolDown} - \opt{IRIVER_H10_PAD}{\ButtonRew / \ButtonFF} - \opt{HAVEREMOTEKEYMAP}{& } + \opt{HAVEREMOTEKEYMAP}{ + & + } & Mouse wheel scroll up / down, respectively \\ \end{btnmap} \end{table}