CONSOLE DEMO This demo shows how the Matrix handles terminal IO.
sourcecode: #!/usr/local/matrix/bin/matrixuse con = console@localhost(""); include c = calc(""); string s; -> con:read('a') { con:writeln("You have pressed the key 'a'"); } -> con:read('b') { con:writeln("You have pressed the key 'b'"); } -> con:read(^s) { con:write("This event matches for every key. The matrix got key '"); con:write(s); con:writeln("'"); if (s == 'e') exit(0); } |
||||||||||||
download console demo here |