mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Removed duplicate Ctrl+C-Handling from term.read
The event library already takes care about that. (returning an "interrupted" event) I noticed that because I couldn't exit command lines reliably. (The Ctrl+C-Handling in the event library replaces some events.)
This commit is contained in:
parent
554192eeff
commit
315aa57a0c
@ -357,9 +357,6 @@ function term.read(history, dobreak, hint, pwchar, filter)
|
|||||||
history[#history] = ""
|
history[#history] = ""
|
||||||
return true, nil
|
return true, nil
|
||||||
end
|
end
|
||||||
elseif keyboard.isControlDown() and code == keyboard.keys.c then
|
|
||||||
history[#history] = ""
|
|
||||||
return true, nil
|
|
||||||
elseif not keyboard.isControl(char) then
|
elseif not keyboard.isControl(char) then
|
||||||
insert(unicode.char(char))
|
insert(unicode.char(char))
|
||||||
end
|
end
|
||||||
@ -402,6 +399,10 @@ function term.read(history, dobreak, hint, pwchar, filter)
|
|||||||
cleanup()
|
cleanup()
|
||||||
error("interrupted", 0)
|
error("interrupted", 0)
|
||||||
end
|
end
|
||||||
|
if name == "interrupted" then
|
||||||
|
cleanup()
|
||||||
|
return nil
|
||||||
|
end
|
||||||
local ncx, ncy = getCursor()
|
local ncx, ncy = getCursor()
|
||||||
if ocx ~= ncx or ocy ~= ncy then
|
if ocx ~= ncx or ocy ~= ncy then
|
||||||
cleanup()
|
cleanup()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user