about summary refs log tree commit diff stats
path: root/074keyboard.mu
diff options
context:
space:
mode:
Diffstat (limited to '074keyboard.mu')
-rw-r--r--074keyboard.mu15
1 files changed, 15 insertions, 0 deletions
diff --git a/074keyboard.mu b/074keyboard.mu
index 9cea3d1f..d79d20f6 100644
--- a/074keyboard.mu
+++ b/074keyboard.mu
@@ -51,3 +51,18 @@ recipe wait-for-key [
   c:character <- wait-for-key-from-keyboard
   reply c:character, x:address:keyboard/same-as-ingredient:0
 ]
+
+recipe send-keys-to-channel [
+  default-space:address:array:location <- new location:type, 30:literal
+  keyboard:address <- next-ingredient
+  chan:address:channel <- next-ingredient
+  screen:address <- next-ingredient
+  {
+    c:character <- read-key keyboard:address
+    loop-unless c:character
+    print-character screen:address, c:character
+    chan:address:channel <- write chan:address:channel, c:character
+    # todo: eof
+    loop
+  }
+]