mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Hopefully get all of the touchscreen drivers to act the same so release events get the appropriate data.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22314 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
65eaf60b35
commit
7ca4c7358d
3 changed files with 15 additions and 5 deletions
|
|
@ -103,11 +103,12 @@ int button_read_device(int *data)
|
|||
{
|
||||
int btn = BUTTON_NONE;
|
||||
int adc;
|
||||
static int old_data = 0;
|
||||
|
||||
static bool hold_button = false;
|
||||
bool hold_button_old;
|
||||
|
||||
*data = 0;
|
||||
*data = old_data;
|
||||
|
||||
hold_button_old = hold_button;
|
||||
hold_button = button_hold();
|
||||
|
|
@ -188,7 +189,7 @@ int button_read_device(int *data)
|
|||
{
|
||||
last_x = x;
|
||||
last_y = y;
|
||||
*data = touch_to_pixels(x, y);
|
||||
old_data = *data = touch_to_pixels(x, y);
|
||||
btn |= touchscreen_to_pixels((*data&0xffff0000)>>16,
|
||||
(*data&0x0000ffff),
|
||||
data);
|
||||
|
|
@ -197,12 +198,12 @@ int button_read_device(int *data)
|
|||
last_touch = current_tick;
|
||||
touch_available = false;
|
||||
}
|
||||
|
||||
|
||||
if (!(GPIOA & 0x4))
|
||||
btn |= BUTTON_POWER;
|
||||
|
||||
if(btn & BUTTON_TOUCHSCREEN && !is_backlight_on(true))
|
||||
*data = 0;
|
||||
old_data = *data = 0;
|
||||
|
||||
return btn;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,9 +108,13 @@ inline bool button_hold(void)
|
|||
return hold_button;
|
||||
}
|
||||
|
||||
/* Since this is a touchscreen, the expectation in higher levels is that the
|
||||
* previous touch location is maintained when a release occurs. This is
|
||||
* intended to mimic a mouse or other similar pointing device.
|
||||
*/
|
||||
int button_read_device(int *data)
|
||||
{
|
||||
static int old_data;
|
||||
static int old_data = 0;
|
||||
int button_read = BUTTON_NONE;
|
||||
short touch_x, touch_y, touch_z1, touch_z2;
|
||||
static bool hold_button_old = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue