1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-30 07:03:01 +00:00

build using command computer

This commit is contained in:
kepler155c@gmail.com
2017-08-09 10:19:00 -04:00
parent c21afd2875
commit 97f3392fbd
11 changed files with 211 additions and 124 deletions

View File

@@ -51,14 +51,20 @@ ct.clear()
ct.setCursorPos(1, 1)
local filter = Util.transpose({
'char', 'paste', 'key', 'key_up',
'char', 'paste', 'key', 'key_up', 'terminate',
'mouse_scroll', 'mouse_click', 'mouse_drag', 'mouse_up',
})
while true do
local e = Event.pullEvent()
local e = { os.pullEventRaw() }
local event = e[1]
if filter[event] then
socket:write(e)
else
Event.processEvent(e)
end
if not socket.connected then
print()
print('Connection lost')
@@ -66,16 +72,4 @@ while true do
read()
break
end
if filter[event] then
if not socket:write(e) then
socket:close()
break
end
elseif event == 'terminate' then
socket:close()
break
end
end