diff options
| author | Karl Kurbjun <kkurbjun@gmail.com> | 2009-08-14 23:08:50 +0000 |
|---|---|---|
| committer | Karl Kurbjun <kkurbjun@gmail.com> | 2009-08-14 23:08:50 +0000 |
| commit | 7ca4c7358d6bbbcbe1b5f535e39e73036edb6495 (patch) | |
| tree | c4280d756dd161505e4f6d21b4c23e38892eb982 | |
| parent | 65eaf60b35f88ecaea3143915092971d8386649f (diff) | |
| download | rockbox-7ca4c7358d6bbbcbe1b5f535e39e73036edb6495.zip rockbox-7ca4c7358d6bbbcbe1b5f535e39e73036edb6495.tar.gz rockbox-7ca4c7358d6bbbcbe1b5f535e39e73036edb6495.tar.bz2 rockbox-7ca4c7358d6bbbcbe1b5f535e39e73036edb6495.tar.xz | |
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
3 files changed, 15 insertions, 5 deletions
diff --git a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c index 6ff87dd..a9b7265 100644 --- a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c +++ b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c @@ -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; } diff --git a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c index 04acb71..7d9a43f 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c @@ -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; diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c index 24caac0..592d080 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c @@ -158,6 +158,9 @@ bool button_hold(void) int button_read_device(int *data) { int ret = 0; + static int old_data = 0; + + data = old_data; /* Filter button events out if HOLD button is pressed at firmware/ level */ if(button_hold()) @@ -181,6 +184,8 @@ int button_read_device(int *data) ret |= touchscreen_to_pixels(cur_touch >> 16, cur_touch & 0xFFFF, data); if( UNLIKELY(!is_backlight_on(true)) ) *data = 0; + + old_data = data; } return ret; |