mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
tweak
This commit is contained in:
parent
8d0ae537ec
commit
bb0e56594f
@ -1765,8 +1765,8 @@ void touchHandler(bool state, IOEventFlags flags) {
|
||||
|
||||
int tx = buf[3]/* | ((buf[2] & 0x0F)<<8)*/; // top bits are never used on our touchscreen
|
||||
int ty = buf[5]/* | ((buf[4] & 0x0F)<<8)*/;
|
||||
if (tx>250) tx=0; // on some devices, 251-255 gets reported for touches right at the top of the screen
|
||||
if (ty>250) ty=0;
|
||||
if (tx>=250) tx=0; // on some devices, 251-255 gets reported for touches right at the top of the screen
|
||||
if (ty>=250) ty=0;
|
||||
touchHandlerInternal(
|
||||
(tx-touchMinX) * LCD_WIDTH / (touchMaxX-touchMinX), // touchX
|
||||
(ty-touchMinY) * LCD_HEIGHT / (touchMaxY-touchMinY), // touchY
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user