diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2017-11-14 16:47:27 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2017-11-14 16:49:36 +0100 |
commit | ff08c5287dda0ecedba22e8d71d9d75ed3b36342 (patch) | |
tree | d186f05d30e060b8770a5ff95a054185f664365c | |
parent | 5da0cbea31d327fabaccdb5cc57870995b02ea10 (diff) | |
download | rockbox-ff08c5287dda0ecedba22e8d71d9d75ed3b36342.tar.gz rockbox-ff08c5287dda0ecedba22e8d71d9d75ed3b36342.zip |
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
-rw-r--r-- | apps/keymaps/keymap-nwz.c | 13 | ||||
-rw-r--r-- | 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[] = { | |||
103 | { ACTION_KBD_BACKSPACE, BUTTON_BACK, BUTTON_NONE }, | 103 | { ACTION_KBD_BACKSPACE, BUTTON_BACK, BUTTON_NONE }, |
104 | { ACTION_KBD_BACKSPACE, BUTTON_BACK|BUTTON_REPEAT, BUTTON_NONE }, | 104 | { ACTION_KBD_BACKSPACE, BUTTON_BACK|BUTTON_REPEAT, BUTTON_NONE }, |
105 | 105 | ||
106 | { ACTION_KBD_SELECT, BUTTON_POWER, BUTTON_NONE }, | 106 | { ACTION_KBD_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE }, |
107 | { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | 107 | { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, |
108 | { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE }, | ||
108 | 109 | ||
109 | LAST_ITEM_IN_LIST | 110 | LAST_ITEM_IN_LIST |
110 | }; /* button_context_keyboard */ | 111 | }; /* button_context_keyboard */ |
@@ -150,6 +151,14 @@ static const struct button_mapping button_context_radio[] = { | |||
150 | 151 | ||
151 | { ACTION_FM_EXIT, BUTTON_BACK, BUTTON_NONE }, | 152 | { ACTION_FM_EXIT, BUTTON_BACK, BUTTON_NONE }, |
152 | 153 | ||
154 | /* only compiled if there is a Volume UP button defined */ | ||
155 | #ifdef BUTTON_VOL_UP | ||
156 | { ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE }, | ||
157 | { ACTION_SETTINGS_INCREPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
158 | { ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
159 | { ACTION_SETTINGS_DECREPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
160 | #endif /* BUTTON_VOL_UP */ | ||
161 | |||
153 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) | 162 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) |
154 | }; /* button_context_radio */ | 163 | }; /* button_context_radio */ |
155 | #endif | 164 | #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 @@ | |||
94 | (CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_CLIP_PAD) ||\ | 94 | (CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_CLIP_PAD) ||\ |
95 | (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD)||(CONFIG_KEYPAD == COWON_D2_PAD)||\ | 95 | (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD)||(CONFIG_KEYPAD == COWON_D2_PAD)||\ |
96 | (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD)||(CONFIG_KEYPAD == MPIO_HD200_PAD)||\ | 96 | (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD)||(CONFIG_KEYPAD == MPIO_HD200_PAD)||\ |
97 | (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) | 97 | (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || (CONFIG_KEYPAD == SONY_NWZ_PAD) |
98 | #define FM_MENU | 98 | #define FM_MENU |
99 | #define FM_PRESET | 99 | #define FM_PRESET |
100 | #define FM_STOP | 100 | #define FM_STOP |