diff options
Diffstat (limited to 'cpp/keyboard.mu')
-rw-r--r-- | cpp/keyboard.mu | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/keyboard.mu b/cpp/keyboard.mu new file mode 100644 index 00000000..d6f728f6 --- /dev/null +++ b/cpp/keyboard.mu @@ -0,0 +1,14 @@ +# example 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 +] |