forked from len0rd/rockbox
beginings of a working touchscreen interface for the WPS. 2 new tags:
%T|x|y|width|height|action| <- setup a region (relative to the current viewport) where if pressed the "action" will be done (currently play/stop/prev/next/menu/browse work, suggestions for others to add and better names welcome) %Tl<timeout> <- used as a conditional to say if the touchscreen was touched in the last <timeout>, use this to enable/disable button viewports or something... same syntax as other timeout tags cabbiev2 for the mr500 has been modified to demonstrate the new tags. press the pause/play button to pause playback. press the rockbox logo to get back to the menu. pretty icons needed to make this more usable :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20753 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
88b509b7d2
commit
0eb5dc649f
8 changed files with 215 additions and 8 deletions
|
@ -81,6 +81,9 @@ static int button_read(int *data);
|
|||
static int button_read(void);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TOUCHSCREEN
|
||||
int last_touchscreen_touch;
|
||||
#endif
|
||||
#if defined(HAVE_HEADPHONE_DETECTION)
|
||||
static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */
|
||||
/* This callback can be used for many different functions if needed -
|
||||
|
@ -406,7 +409,9 @@ void button_init(void)
|
|||
remote_filter_first_keypress = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TOUCHSCREEN
|
||||
last_touchscreen_touch = 0xffff;
|
||||
#endif
|
||||
/* Start polling last */
|
||||
tick_add_task(button_tick);
|
||||
}
|
||||
|
@ -522,7 +527,10 @@ static int button_read(void)
|
|||
if (btn && flipped)
|
||||
btn = button_flip(btn); /* swap upside down */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TOUCHSCREEN
|
||||
if (btn & BUTTON_TOUCHSCREEN)
|
||||
last_touchscreen_touch = current_tick;
|
||||
#endif
|
||||
/* Filter the button status. It is only accepted if we get the same
|
||||
status twice in a row. */
|
||||
#ifndef HAVE_TOUCHSCREEN
|
||||
|
@ -536,7 +544,6 @@ static int button_read(void)
|
|||
return retval;
|
||||
}
|
||||
|
||||
|
||||
int button_status(void)
|
||||
{
|
||||
return lastbtn;
|
||||
|
@ -547,6 +554,12 @@ void button_clear_queue(void)
|
|||
queue_clear(&button_queue);
|
||||
}
|
||||
|
||||
#ifdef HAVE_TOUCHSCREEN
|
||||
int touchscreen_last_touch(void)
|
||||
{
|
||||
return last_touchscreen_touch;
|
||||
}
|
||||
#endif
|
||||
#endif /* SIMULATOR */
|
||||
|
||||
#ifdef HAVE_WHEEL_ACCELERATION
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue