xduoo_x3ii: Improvements in the meymappings!

* PREV/NEXT now swapped so they do what is expected in most contexts
 * List and setting context retains prior behavior
 * Enable the ADC that reads the headset remote and map the keys.
 * As ADC-based remote "events" arrive as press/release pairs,
   delay the button release.

Change-Id: I22d4eac3bfe1573b50eca795cf377bdafdeb5336
This commit is contained in:
Solomon Peachy 2021-03-10 19:03:00 -05:00
parent a87abdb28f
commit 87e37a4d48
6 changed files with 68 additions and 30 deletions

View file

@ -36,6 +36,8 @@
#define BUTTON_MAIN (BUTTON_POWER | BUTTON_HOME | BUTTON_OPTION | BUTTON_PREV | \
BUTTON_NEXT | BUTTON_PLAY | BUTTON_VOL_UP | BUTTON_VOL_DOWN)
#define BUTTON_DELAY_RELEASE 0x00010000
/* Software power-off */
#define POWEROFF_BUTTON BUTTON_POWER
#define POWEROFF_COUNT 25

View file

@ -37,10 +37,10 @@ int button_map(int keycode)
return BUTTON_OPTION;
case KEY_UP:
return BUTTON_PREV;
return BUTTON_NEXT;
case KEY_DOWN:
return BUTTON_NEXT;
return BUTTON_PREV;
case KEY_ENTER:
return BUTTON_PLAY;
@ -54,6 +54,17 @@ int button_map(int keycode)
case KEY_POWER:
return BUTTON_POWER;
#if defined(XDUOO_X3II) /* Headphone remote */
case KEY_NEXTSONG:
return (BUTTON_NEXT | BUTTON_DELAY_RELEASE);
case KEY_PLAYPAUSE:
return (BUTTON_PLAY | BUTTON_DELAY_RELEASE);
case KEY_PREVIOUSSONG:
return (BUTTON_PREV | BUTTON_DELAY_RELEASE);
#endif
default:
return 0;
}