CONSOLE DEMO

This demo shows how the Matrix handles terminal IO.

1. Start the mtx.portmap daemon on your computer
> /usr/local/bin/mtx.portmap
2. Start the console device in one xterm on your machine
> /usr/local/martix/bin/devconsole
3.

Start the testconsole script in an other xterm
> /usr/local/matrix/bin/testconsole

4. Move the mouse to the xterm where the devconsole is running
5. Press some keys and watch the output on in the terminal
6. Look at the testconsole script and find out how it works.

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