From 83ad20cd9de892e11916994f1df377abafa61f44 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Wed, 19 Apr 2017 03:42:25 +1000 Subject: [PATCH] Fixed lossy events. --- modules/base/header.lua | 1 - modules/drivers/keyboard.lua | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/base/header.lua b/modules/base/header.lua index 75a3558..b378fc1 100644 --- a/modules/base/header.lua +++ b/modules/base/header.lua @@ -7,5 +7,4 @@ function l() end function h(...) computer.pushSignal(...) - coroutine.yield() end diff --git a/modules/drivers/keyboard.lua b/modules/drivers/keyboard.lua index 8babe95..b147843 100644 --- a/modules/drivers/keyboard.lua +++ b/modules/drivers/keyboard.lua @@ -4,7 +4,9 @@ function readln() while true do if ev[1] == "key_down" then if ev[3] == 13 then - h("display","\127\n") return s + h("display","\127\n") + C.yield() + return s elseif ev[3] == 8 then if s:len()>0 then s=s:sub(1,-2) h("display","\127\127|") end elseif ev[3] > 31 and ev[3] < 127 then