aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2017-03-28 11:04:19 +0200
committerneodarz <neodarz@neodarz.net>2017-03-28 11:04:19 +0200
commit91b75ad2b9a80c14382ebdc7e2566ef56b1fe999 (patch)
treee14235a158842b5f23c93fbc4eaa23c0824cda69
parent3cfcec5dce2c95b4fdf9caf161473e4b3027b21f (diff)
downloadwaveshare-7inch-touchscreen-driver-91b75ad2b9a80c14382ebdc7e2566ef56b1fe999.tar.xz
waveshare-7inch-touchscreen-driver-91b75ad2b9a80c14382ebdc7e2566ef56b1fe999.zip
Fix bug who don't send data to uinput
-rw-r--r--touch.py6
-rw-r--r--touch_async.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/touch.py b/touch.py
index 71e88ca..4a5a358 100644
--- a/touch.py
+++ b/touch.py
@@ -16,8 +16,8 @@ def read_and_emulate_mouse(deviceFound):
device = uinput.Device([
uinput.BTN_LEFT,
uinput.BTN_RIGHT,
- uinput.ABS_X,
- uinput.ABS_Y,
+ uinput.ABS_X + (0, 1024, 0, 0), #or 800
+ uinput.ABS_Y + (0, 600, 0, 0), #ok 480
])
clicked = False
@@ -33,7 +33,7 @@ def read_and_emulate_mouse(deviceFound):
except:
print('failed to read from deviceFound' + str(deviceFound))
return
-
+
time.sleep(0.01)
if btnLeft:
diff --git a/touch_async.py b/touch_async.py
index 6d3d47e..e80233d 100644
--- a/touch_async.py
+++ b/touch_async.py
@@ -37,8 +37,8 @@ def read_and_emulate_mouse(fd):
input_device = uinput.Device([
uinput.BTN_LEFT,
uinput.BTN_RIGHT,
- uinput.ABS_X,
- uinput.ABS_Y,
+ uinput.ABS_X + (0, 1024, 0, 0), #or 800
+ uinput.ABS_Y + (0, 600, 0, 0), #ok 480
])
clicked = False