From c5ffb6e1cc9c5ff880d037c53b8ebc8562be0008 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 25 May 2015 22:27:19 -0700 Subject: 1459 --- html/keyboard.mu.html | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 html/keyboard.mu.html (limited to 'html/keyboard.mu.html') diff --git a/html/keyboard.mu.html b/html/keyboard.mu.html new file mode 100644 index 00000000..29f32578 --- /dev/null +++ b/html/keyboard.mu.html @@ -0,0 +1,51 @@ + + + + +keyboard.mu + + + + + + + + + + +
+# example program: reading keys from keyboard
+#
+# Keeps printing 'a' until you press a key. Then prints the key you pressed
+# and exits.
+
+recipe main [
+  switch-to-display
+  {
+    c:character, found?:boolean <- read-key-from-keyboard
+    break-if found?:boolean
+    print-character-to-display 97:literal
+    loop
+  }
+  return-to-console
+]
+
+ + + -- cgit 1.4.1-2-gfad0