about summary refs log tree commit diff stats
path: root/keyboard.mu
blob: 530275cab8ab6260655f4416666a50d9e8823665 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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
]