From 5cbeb88541ebbfe388b3d60a1c7564b556b9748b Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 16 May 2021 16:44:01 +0100 Subject: FiiO M3K: keymap improvements & fixes - Add support for skip and seek while the player is locked. (Thanks to @bahus for the suggestion) - Fix touch zones because the down button zone ended up being a lot smaller than expected due to the touchpad's wonkiness. Also added a visual display of the touchpad to its debug menu. - Fixes the pictureflow keymap because it was mostly unusable. Change-Id: Ic0da4f8df3613ff7828ce1cb940ed9e77ada3281 --- apps/keymaps/keymap-fiiom3k.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'apps/keymaps/keymap-fiiom3k.c') diff --git a/apps/keymaps/keymap-fiiom3k.c b/apps/keymaps/keymap-fiiom3k.c index 440f851650..94d2dbc172 100644 --- a/apps/keymaps/keymap-fiiom3k.c +++ b/apps/keymaps/keymap-fiiom3k.c @@ -76,6 +76,16 @@ static const struct button_mapping button_context_wps[] = { LAST_ITEM_IN_LIST }; /* button_context_wps */ +static const struct button_mapping button_context_wps_locked[] = { + {ACTION_WPS_SKIPNEXT, BUTTON_VOL_UP|BUTTON_REL, BUTTON_PLAY|BUTTON_VOL_UP}, + {ACTION_WPS_SEEKFWD, BUTTON_PLAY|BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE}, + {ACTION_WPS_STOPSEEK, BUTTON_PLAY|BUTTON_VOL_UP|BUTTON_REL, BUTTON_PLAY|BUTTON_VOL_UP|BUTTON_REPEAT}, + {ACTION_WPS_SKIPPREV, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_PLAY|BUTTON_VOL_DOWN}, + {ACTION_WPS_SEEKBACK, BUTTON_PLAY|BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE}, + {ACTION_WPS_STOPSEEK, BUTTON_PLAY|BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_PLAY|BUTTON_VOL_DOWN|BUTTON_REPEAT}, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_WPS) +}; /* button_context_wps_locked */ + static const struct button_mapping button_context_tree[] = { {ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY}, {ACTION_TREE_WPS, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK}, @@ -242,6 +252,15 @@ static const struct button_mapping button_context_usb_hid_mode_browser[] = { const struct button_mapping* get_context_mapping(int context) { + switch (context) + { + case CONTEXT_WPS|CONTEXT_LOCKED: + return button_context_wps_locked; + default: + context &= ~CONTEXT_LOCKED; + break; + } + switch (context) { default: -- cgit v1.2.3