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.
|
|
|
|
|
2016-03-08 09:30:14 +00:00
|
|
|
def main [
|
2016-02-13 21:22:22 +00:00
|
|
|
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
|
2015-07-29 08:23:22 +00:00
|
|
|
break-if found?
|
2015-07-28 21:33:22 +00:00
|
|
|
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
|
|
|
]
|