networking improvements

This commit is contained in:
kepler155c@gmail.com
2017-05-10 06:11:25 -04:00
parent f866d2bd58
commit 3a922ad2f4
10 changed files with 97 additions and 57 deletions

View File

@@ -52,8 +52,12 @@ end)
ct.clear()
ct.setCursorPos(1, 1)
local filter = Util.invert({
'char', 'paste', 'key', 'key_up', 'mouse_scroll', 'mouse_click', 'mouse_drag',
})
while true do
local e = { process:pullEvent(nil, true) }
local e = { process:pullEvent() }
local event = e[1]
if not socket.connected then
@@ -64,13 +68,7 @@ while true do
break
end
if event == 'char' or
event == 'paste' or
event == 'key' or
event == 'key_up' or
event == 'mouse_scroll' or
event == 'mouse_click' or
event == 'mouse_drag' then
if filter[event] then
if not socket:write({ type = 'shellRemote', event = e }) then
socket:close()