xduoox3: Add HID mappings for multimedia and presentation modes

Change-Id: I7264fed77c448db4b54104d81a10e118923c361d
This commit is contained in:
Solomon Peachy 2020-07-15 11:41:08 -04:00
parent c54170e8f6
commit 058ba97f62

View file

@ -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;
}