From ff08c5287dda0ecedba22e8d71d9d75ed3b36342 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 14 Nov 2017 16:47:27 +0100 Subject: [PATCH] nwz: improve keymap - enable various features in radio screen (like mode switch) - improve keyboard (short play to select, long play to finish, power to abort) - enable volume keys in radio screen if available Change-Id: I01e71291cfd783763ffd55d4fa60610b6900c726 --- apps/keymaps/keymap-nwz.c | 13 +++++++++++-- apps/radio/radio.c | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/keymaps/keymap-nwz.c b/apps/keymaps/keymap-nwz.c index 406bfa19dc..e676f8126e 100644 --- a/apps/keymaps/keymap-nwz.c +++ b/apps/keymaps/keymap-nwz.c @@ -103,8 +103,9 @@ static const struct button_mapping button_context_keyboard[] = { { ACTION_KBD_BACKSPACE, BUTTON_BACK, BUTTON_NONE }, { ACTION_KBD_BACKSPACE, BUTTON_BACK|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_SELECT, BUTTON_POWER, BUTTON_NONE }, - { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, + { ACTION_KBD_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE }, + { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE }, LAST_ITEM_IN_LIST }; /* button_context_keyboard */ @@ -150,6 +151,14 @@ static const struct button_mapping button_context_radio[] = { { ACTION_FM_EXIT, BUTTON_BACK, BUTTON_NONE }, +/* only compiled if there is a Volume UP button defined */ +#ifdef BUTTON_VOL_UP + { ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE }, + { ACTION_SETTINGS_INCREPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE }, + { ACTION_SETTINGS_DECREPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, +#endif /* BUTTON_VOL_UP */ + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) }; /* button_context_radio */ #endif diff --git a/apps/radio/radio.c b/apps/radio/radio.c index 77fd324c8f..49534ee3dc 100644 --- a/apps/radio/radio.c +++ b/apps/radio/radio.c @@ -94,7 +94,7 @@ (CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_CLIP_PAD) ||\ (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD)||(CONFIG_KEYPAD == COWON_D2_PAD)||\ (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD)||(CONFIG_KEYPAD == MPIO_HD200_PAD)||\ - (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) + (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || (CONFIG_KEYPAD == SONY_NWZ_PAD) #define FM_MENU #define FM_PRESET #define FM_STOP