summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-05-15 05:08:28 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-05-15 05:08:28 +0000
commitd48f1a0a4545316e024f7ccfd78112f6d1a466f5 (patch)
tree5fc034849c38a14c2f57a78798084644f9d6f836
parent6df03c6d53051e44bcc9b879408542c40c79db5e (diff)
downloadrockbox-d48f1a0a4545316e024f7ccfd78112f6d1a466f5.zip
rockbox-d48f1a0a4545316e024f7ccfd78112f6d1a466f5.tar.gz
rockbox-d48f1a0a4545316e024f7ccfd78112f6d1a466f5.tar.bz2
rockbox-d48f1a0a4545316e024f7ccfd78112f6d1a466f5.tar.xz
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.c27
-rw-r--r--apps/keymaps/keymap-mr500.c7
2 files changed, 32 insertions, 2 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index 4eaffa0..7100eb7 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)
talk_qs_option((struct settings_list *)qs->items[item], false);
return true;
}
-
+#ifdef HAVE_TOUCHSCREEN
+/* figure out which button was pressed...
+ * top is exit, left/right/botton are the respective actions
+ */
+static int quickscreen_touchscreen_button(void)
+{
+ short x,y;
+ if (action_get_touchscreen_press(&x, &y) != BUTTON_REL)
+ return ACTION_NONE;
+ if (y < vps[SCREEN_MAIN][QUICKSCREEN_LEFT].y)
+ return ACTION_STD_CANCEL;
+ else if (y > vps[SCREEN_MAIN][QUICKSCREEN_LEFT].y +
+ vps[SCREEN_MAIN][QUICKSCREEN_LEFT].height)
+ return ACTION_QS_DOWN;
+ else if (x < vps[SCREEN_MAIN][QUICKSCREEN_LEFT].x +
+ vps[SCREEN_MAIN][QUICKSCREEN_LEFT].width)
+ return ACTION_QS_LEFT;
+ else if (x >= vps[SCREEN_MAIN][QUICKSCREEN_RIGHT].x)
+ return ACTION_QS_RIGHT;
+ return ACTION_STD_CANCEL;
+}
+#endif
bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter)
{
int button, i;
@@ -303,6 +324,10 @@ bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter)
talk_qs_option((struct settings_list *)qs->items[QUICKSCREEN_RIGHT], true);
while (true) {
button = get_action(CONTEXT_QUICKSCREEN,HZ/5);
+#ifdef HAVE_TOUCHSCREEN
+ if (button == ACTION_TOUCHSCREEN)
+ button = quickscreen_touchscreen_button();
+#endif
if(default_event_handler(button) == SYS_USB_CONNECTED)
return(true);
if(gui_quickscreen_do_button(qs, button))
diff --git a/apps/keymaps/keymap-mr500.c b/apps/keymaps/keymap-mr500.c
index cd3e30d..7bb7c80 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[] = {
}; /* button_context_time */
static const struct button_mapping button_context_quickscreen[] = {
+ { ACTION_STD_CANCEL, BUTTON_RC_MODE, BUTTON_NONE },
+ { ACTION_QS_DOWNINV, BUTTON_RC_UP, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_RC_DOWN, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_RC_LEFT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_RC_RIGHT, BUTTON_NONE },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+ LAST_ITEM_IN_LIST
}; /* button_context_quickscreen */
static const struct button_mapping button_context_pitchscreen[] = {