mu/archive/1.vm/console.mu

17 lines
337 B
Forth
Raw Normal View History

2015-06-22 06:37:49 +00:00
# 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
2015-06-22 06:53:17 +00:00
open-console
2015-06-22 06:37:49 +00:00
{
2016-10-08 17:52:58 +00:00
e:event, found?:bool <- check-for-interaction
break-if found?
print-character-to-display 97, 7/white
2015-06-22 06:37:49 +00:00
loop
}
2015-06-22 06:53:17 +00:00
close-console
2015-09-03 02:18:24 +00:00
$print e, 10/newline
2015-06-22 06:37:49 +00:00
]