# Mu - console.mu

     1 # example program: reading events from keyboard or mouse
     2 #
     3 # Keeps printing 'a' until you press a key or click on the mouse.
     4
     5 def main [
     6   local-scope
     7   open-console
     8   {
     9     e:event, found?:bool <- check-for-interaction
    10     break-if found?
    11     print-character-to-display 97, 7/white
    12     loop
    13   }
    14   close-console
    15   $print e, 10/newline
    16 ]