initial commit with all the stuff
This commit is contained in:
21
3B/archive/root_4.bak/touch.lua
Normal file
21
3B/archive/root_4.bak/touch.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
local evdev = require "evdev"
|
||||
|
||||
local dev = evdev.Device("/dev/input/event0")
|
||||
|
||||
local x = 0
|
||||
local y = 0
|
||||
|
||||
while true do
|
||||
local timestamp, eventType, eventCode, value = dev:read()
|
||||
if eventType == evdev.EV_ABS then
|
||||
if eventCode == 57 then
|
||||
if value < 0 then
|
||||
print("Up: ",x,y)
|
||||
end
|
||||
elseif eventCode == 0 then
|
||||
y = value
|
||||
elseif eventCode == 1 then
|
||||
x = value
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user