about summary refs log tree commit diff stats
path: root/anagrams.tlv
diff options
context:
space:
mode:
Diffstat (limited to 'anagrams.tlv')
-rw-r--r--anagrams.tlv12
1 files changed, 11 insertions, 1 deletions
diff --git a/anagrams.tlv b/anagrams.tlv
index 9a20f26..06e760e 100644
--- a/anagrams.tlv
+++ b/anagrams.tlv
@@ -228,6 +228,7 @@
 - __teliva_timestamp: original
   main:
     >function main()
+    >  Window:nodelay(true)
     >  while true do
     >    render(Window)
     >    update(Window)
@@ -236,7 +237,11 @@
 - __teliva_timestamp: original
   update:
     >function update(window)
-    >  local key = window:getch()
+    >  local key
+    >  while true do
+    >    key = window:getch()
+    >    if key then break end
+    >  end
     >  if key == curses.KEY_LEFT then
     >    if cursor > 1 then
     >      cursor = cursor-1
@@ -277,6 +282,11 @@
     >    for i, w in ipairs(results) do
     >      window:addstr(w)
     >      window:addstr(' ')
+    >      local tmp = window:getch()
+    >      if tmp then
+    >        window:ungetch(tmp)
+    >        break
+    >      end
     >    end
     >  end
     >