diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-05-15 05:08:28 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-05-15 05:08:28 +0000 |
commit | d48f1a0a4545316e024f7ccfd78112f6d1a466f5 (patch) | |
tree | 5fc034849c38a14c2f57a78798084644f9d6f836 | |
parent | 6df03c6d53051e44bcc9b879408542c40c79db5e (diff) | |
download | rockbox-d48f1a0a4545316e024f7ccfd78112f6d1a466f5.tar.gz rockbox-d48f1a0a4545316e024f7ccfd78112f6d1a466f5.zip |
get the quickscreen working on the mr500. hold "mode" on the remote to get to it, then you can use the 4 directions on the remote, or the touchscreen to change the values. "mode" will exit, as will pressing in the top or middle of the main screen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20935 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/quickscreen.c | 27 | ||||
-rw-r--r-- | apps/keymaps/keymap-mr500.c | 7 |
2 files changed, 32 insertions, 2 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index 4eaffa0f46..7100eb7489 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c | |||
@@ -275,7 +275,28 @@ static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) | |||
275 | talk_qs_option((struct settings_list *)qs->items[item], false); | 275 | talk_qs_option((struct settings_list *)qs->items[item], false); |
276 | return true; | 276 | return true; |
277 | } | 277 | } |
278 | 278 | #ifdef HAVE_TOUCHSCREEN | |
279 | /* figure out which button was pressed... | ||
280 | * top is exit, left/right/botton are the respective actions | ||
281 | */ | ||
282 | static int quickscreen_touchscreen_button(void) | ||
283 | { | ||
284 | short x,y; | ||
285 | if (action_get_touchscreen_press(&x, &y) != BUTTON_REL) | ||
286 | return ACTION_NONE; | ||
287 | if (y < vps[SCREEN_MAIN][QUICKSCREEN_LEFT].y) | ||
288 | return ACTION_STD_CANCEL; | ||
289 | else if (y > vps[SCREEN_MAIN][QUICKSCREEN_LEFT].y + | ||
290 | vps[SCREEN_MAIN][QUICKSCREEN_LEFT].height) | ||
291 | return ACTION_QS_DOWN; | ||
292 | else if (x < vps[SCREEN_MAIN][QUICKSCREEN_LEFT].x + | ||
293 | vps[SCREEN_MAIN][QUICKSCREEN_LEFT].width) | ||
294 | return ACTION_QS_LEFT; | ||
295 | else if (x >= vps[SCREEN_MAIN][QUICKSCREEN_RIGHT].x) | ||
296 | return ACTION_QS_RIGHT; | ||
297 | return ACTION_STD_CANCEL; | ||
298 | } | ||
299 | #endif | ||
279 | bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) | 300 | bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) |
280 | { | 301 | { |
281 | int button, i; | 302 | int button, i; |
@@ -303,6 +324,10 @@ bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) | |||
303 | talk_qs_option((struct settings_list *)qs->items[QUICKSCREEN_RIGHT], true); | 324 | talk_qs_option((struct settings_list *)qs->items[QUICKSCREEN_RIGHT], true); |
304 | while (true) { | 325 | while (true) { |
305 | button = get_action(CONTEXT_QUICKSCREEN,HZ/5); | 326 | button = get_action(CONTEXT_QUICKSCREEN,HZ/5); |
327 | #ifdef HAVE_TOUCHSCREEN | ||
328 | if (button == ACTION_TOUCHSCREEN) | ||
329 | button = quickscreen_touchscreen_button(); | ||
330 | #endif | ||
306 | if(default_event_handler(button) == SYS_USB_CONNECTED) | 331 | if(default_event_handler(button) == SYS_USB_CONNECTED) |
307 | return(true); | 332 | return(true); |
308 | if(gui_quickscreen_do_button(qs, button)) | 333 | if(gui_quickscreen_do_button(qs, button)) |
diff --git a/apps/keymaps/keymap-mr500.c b/apps/keymaps/keymap-mr500.c index cd3e30dae1..7bb7c80f67 100644 --- a/apps/keymaps/keymap-mr500.c +++ b/apps/keymaps/keymap-mr500.c | |||
@@ -166,8 +166,13 @@ static const struct button_mapping button_context_time[] = { | |||
166 | }; /* button_context_time */ | 166 | }; /* button_context_time */ |
167 | 167 | ||
168 | static const struct button_mapping button_context_quickscreen[] = { | 168 | static const struct button_mapping button_context_quickscreen[] = { |
169 | { ACTION_STD_CANCEL, BUTTON_RC_MODE, BUTTON_NONE }, | ||
170 | { ACTION_QS_DOWNINV, BUTTON_RC_UP, BUTTON_NONE }, | ||
171 | { ACTION_QS_DOWN, BUTTON_RC_DOWN, BUTTON_NONE }, | ||
172 | { ACTION_QS_LEFT, BUTTON_RC_LEFT, BUTTON_NONE }, | ||
173 | { ACTION_QS_RIGHT, BUTTON_RC_RIGHT, BUTTON_NONE }, | ||
169 | 174 | ||
170 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | 175 | LAST_ITEM_IN_LIST |
171 | }; /* button_context_quickscreen */ | 176 | }; /* button_context_quickscreen */ |
172 | 177 | ||
173 | static const struct button_mapping button_context_pitchscreen[] = { | 178 | static const struct button_mapping button_context_pitchscreen[] = { |