summaryrefslogtreecommitdiffstats
path: root/apps/keymaps/keymap-xduoox3.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-15 11:41:08 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-15 11:43:39 -0400
commit058ba97f62a4a066440538a5d80b9e2699c397b3 (patch)
treebe260bb31f5befba8630acb9f9aab08b8affcc88 /apps/keymaps/keymap-xduoox3.c
parentc54170e8f61614fc7df8abcd2cbb5727a85a7692 (diff)
downloadrockbox-058ba97f62a4a066440538a5d80b9e2699c397b3.tar.gz
rockbox-058ba97f62a4a066440538a5d80b9e2699c397b3.tar.bz2
rockbox-058ba97f62a4a066440538a5d80b9e2699c397b3.zip
xduoox3: Add HID mappings for multimedia and presentation modes
Change-Id: I7264fed77c448db4b54104d81a10e118923c361d
Diffstat (limited to 'apps/keymaps/keymap-xduoox3.c')
-rw-r--r--apps/keymaps/keymap-xduoox3.c56
1 files changed, 55 insertions, 1 deletions
diff --git a/apps/keymaps/keymap-xduoox3.c b/apps/keymaps/keymap-xduoox3.c
index c09090021c..83314532b6 100644
--- a/apps/keymaps/keymap-xduoox3.c
+++ b/apps/keymaps/keymap-xduoox3.c
@@ -116,7 +116,7 @@ static const struct button_mapping button_context_pitchscreen[] = {
{ ACTION_PS_INC_SMALL, BUTTON_VOL_UP, BUTTON_NONE },
{ ACTION_PS_INC_BIG, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_PS_DEC_SMALL, BUTTON_VOL_DOWN, BUTTON_NONE },
- { ACTION_PS_DEC_BIG, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_PS_DEC_BIG, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_PS_NUDGE_LEFT, BUTTON_PREV, BUTTON_NONE },
{ ACTION_PS_NUDGE_LEFTOFF, BUTTON_PREV|BUTTON_REL, BUTTON_NONE },
{ ACTION_PS_NUDGE_RIGHT, BUTTON_NEXT, BUTTON_NONE },
@@ -183,6 +183,52 @@ static const struct button_mapping button_context_yesnoscreen[] = {
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_settings_yesnoscreen */
+#ifdef USB_ENABLE_HID
+static const struct button_mapping button_context_usb_hid[] = {
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_OPTION|BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_OPTION|BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_OPTION|BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_OPTION|BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV },
+
+ 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_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_HOME|BUTTON_REL, BUTTON_HOME },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
+
+ 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_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_HOME|BUTTON_REL, BUTTON_HOME },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_OPTION|BUTTON_REL, BUTTON_OPTION },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_OPTION|BUTTON_REPEAT, BUTTON_OPTION },
+ { 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_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+// XXX TODO: browser and HID mouse mode?
+#endif
+
/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
const struct button_mapping* get_context_mapping(int context)
{
@@ -214,6 +260,14 @@ const struct button_mapping* get_context_mapping(int context)
return button_context_wps;
case CONTEXT_YESNOSCREEN:
return button_context_yesnoscreen;
+#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;
+#endif
}
return button_context_standard;
}