theoretically should be full support now

This commit is contained in:
ocawesome101 2021-06-04 16:27:14 -04:00
parent 8260c8f59f
commit 300e2d1190

View File

@ -111,11 +111,14 @@ function computer.signalTransformers.key_down(s, a, ascii, key, user)
end end
if ascii == 27 then if ascii == 27 then
inesc = true inesc = true
return nil
elseif inesc then elseif inesc then
if ascii < 48 and ascii > 57 and ascii ~= 59 then if ascii < 48 and ascii > 57 and ascii ~= 59 then
inesc = false inesc = false
key = escmap[ascii] or 0 key = escmap[ascii] or 0
ascii = 0 ascii = 0
else
return nil
end end
end end
return s, a, math.floor(asciitr[ascii] or ascii), keymap[ascii] or key, user return s, a, math.floor(asciitr[ascii] or ascii), keymap[ascii] or key, user
@ -125,13 +128,28 @@ function computer.signalTransformers.key_up(s, a, ascii, key, user)
if key ~= -1 then if key ~= -1 then
return s, a, ascii, key, user return s, a, ascii, key, user
end end
if ascii == 27 then
inesc = true
return nil
elseif inesc then
if ascii < 48 and ascii > 57 and ascii ~= 59 then
inesc = false
key = escmap[ascii] or 0
ascii = 0
else
return nil
end
end
return s, a, math.floor(asciitr[ascii] or ascii), keymap[ascii] or key, user return s, a, math.floor(asciitr[ascii] or ascii), keymap[ascii] or key, user
end end
----- -----
function api.pushSignal(s, ...) function api.pushSignal(s, ...)
signalQueue[#signalQueue + 1] = {computer.signalTransformers[s](s, ...)} local result = table.pack(computer.signalTransformers[s](s, ...))
if result.n == 0 then return end
result.n = nil
signalQueue[#signalQueue + 1] = result
end end
function api.pullSignal(timeout) function api.pullSignal(timeout)