several more fixes #2

Open
Ocawesome101 wants to merge 19 commits from Ocawesome101/LuPPC:master into master
Showing only changes of commit 300e2d1190 - Show all commits

View File

@ -111,11 +111,14 @@ function computer.signalTransformers.key_down(s, a, ascii, key, user)
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
@ -125,13 +128,28 @@ function computer.signalTransformers.key_up(s, a, ascii, key, user)
if key ~= -1 then
return s, a, ascii, key, user
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
end
-----
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
function api.pullSignal(timeout)