Fix keymap for YP-R0 regarding broken keylock, add more key maps

Keylock is now toggled by the key combo User&Power for WPS and FMS.
Pitchscreen has been added as long press of User.

While in bookmark screen, short press of Power deletes bookmark.
While in (most) menus or tree, first press of MENU takes you back to the
main menu, second press to WPS (aka button_context_tree).

Removed ACTION_WPSAB_SINGLE as long press of USER is now Pitchscreen.

Change-Id: I6aee7f8655b1073ed8d74dabe73895a7c0e54bfe
This commit is contained in:
Johannes Rauh 2017-08-14 13:05:32 +02:00 committed by Frank Gevaerts
parent c1097cc847
commit 638eaeb884

View file

@ -52,15 +52,20 @@ static const struct button_mapping button_context_standard[] = {
{ ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
{ ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
{ ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
{ ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
{ ACTION_STD_KEYLOCK, BUTTON_USER|BUTTON_POWER, BUTTON_NONE },
LAST_ITEM_IN_LIST
}; /* button_context_standard */
static const struct button_mapping button_context_mainmenu[] = {
{ ACTION_TREE_WPS, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_TREE),
}; /* button_context_mainmenu */
static const struct button_mapping button_context_wps[] = {
{ ACTION_WPS_PLAY, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
{ ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE },
@ -68,10 +73,13 @@ static const struct button_mapping button_context_wps[] = {
{ ACTION_WPS_BROWSE, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
{ ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
/* NOTE: this is available only enabling AB-Repeat mode */
{ ACTION_WPS_HOTKEY, BUTTON_USER|BUTTON_REL, BUTTON_USER },
{ ACTION_WPSAB_SINGLE, BUTTON_USER|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
{ ACTION_WPS_PITCHSCREEN, BUTTON_USER|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_KEYLOCK, BUTTON_USER|BUTTON_POWER, BUTTON_NONE },
{ ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
{ ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
@ -83,7 +91,6 @@ static const struct button_mapping button_context_wps[] = {
{ ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
{ ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
{ ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
@ -140,8 +147,7 @@ static const struct button_mapping button_context_colorchooser[] = { //check
}; /* button_context_colorchooser */
static const struct button_mapping button_context_eq[] = {
{ ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
{ ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
{ ACTION_SETTINGS_INC, BUTTON_RIGHT , BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_LEFT , BUTTON_NONE },
@ -152,11 +158,12 @@ static const struct button_mapping button_context_eq[] = {
/** Bookmark Screen **/
static const struct button_mapping button_context_bmark[] = {
{ ACTION_BMS_DELETE, BUTTON_POWER, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
}; /* button_context_bmark */
static const struct button_mapping button_context_time[] = {
{ ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
@ -170,7 +177,6 @@ static const struct button_mapping button_context_time[] = {
}; /* button_context_time */
static const struct button_mapping button_context_quickscreen[] = {
{ ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE },
{ ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
@ -185,7 +191,6 @@ static const struct button_mapping button_context_quickscreen[] = {
}; /* button_context_quickscreen */
static const struct button_mapping button_context_pitchscreen[] = {
{ ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
{ ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
@ -208,7 +213,6 @@ static const struct button_mapping button_context_pitchscreen[] = {
}; /* button_context_pitchcreen */
static const struct button_mapping button_context_keyboard[] = {
{ ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
{ ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
@ -236,7 +240,7 @@ static const struct button_mapping button_context_radio[] = {
{ ACTION_FM_PLAY, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT },
{ ACTION_FM_NEXT_PRESET, BUTTON_USER | BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_FM_PREV_PRESET, BUTTON_USER | BUTTON_LEFT, BUTTON_NONE },
{ ACTION_STD_KEYLOCK, BUTTON_POWER | BUTTON_REL, BUTTON_POWER },
/* Volume */
{ ACTION_SETTINGS_INC, BUTTON_UP | BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_UP, BUTTON_NONE },
@ -261,6 +265,8 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_LIST:
return button_context_list;
case CONTEXT_MAINMENU:
return button_context_mainmenu;
case CONTEXT_TREE:
return button_context_tree;