about summary refs log blame commit diff stats
path: root/console.mu
blob: 062ca3b01427de3be77b15b55d3b5f8e11ff0946 (plain) (tree)
1
2
3
4
5
6
7
8
9



                                                                 
          
             
              
                                            
   
                                                 
                   
                                          

        
               
                      
 
# example program: reading events from keyboard or mouse
#
# Keeps printing 'a' until you press a key or click on the mouse.

def main [
  local-scope
  open-console
  clear-screen 0/screen  # non-scrolling app
  {
    e:event, found?:bool <- check-for-interaction
    break-if found?
    print-character-to-display 97, 7/white
    loop
  }
  close-console
  $print e, 10/newline
]