readme. example.

This commit is contained in:
Christopher Jeffrey 2013-06-18 11:00:41 -05:00
parent d4ce9322cd
commit 5b8a16df23

View File

@ -46,34 +46,12 @@ program.on('keypress', function(ch, key) {
});
program.on('mouse', function(data) {
if (data.action === 'mouseup') return;
program.move(1, program.rows);
program.eraseInLine('right');
if (data.action === 'wheelup') {
program.write('Mouse wheel up at: ' + data.x + ', ' + data.y);
} else if (data.action === 'wheeldown') {
program.write('Mouse wheel down at: ' + data.x + ', ' + data.y);
} else if (data.action === 'mousedown' && data.button === 'left') {
program.write('Left button down at: ' + data.x + ', ' + data.y);
} else if (data.action === 'mousedown' && data.button === 'right') {
program.write('Right button down at: ' + data.x + ', ' + data.y);
} else {
program.write('Mouse at: ' + data.x + ', ' + data.y);
if (data.action === 'mousemove') {
program.move(data.x, data.y);
program.bg('red');
program.write('x');
program.bg('!red');
}
program.move(data.x, data.y);
program.bg('red');
program.write(' ');
program.bg('!red');
});
program.on('focus', function() {
program.move(1, program.rows);
program.write('Gained focus.');
});
program.on('blur', function() {
program.move(1, program.rows);
program.write('Lost focus.');
});
program.alternateBuffer();
@ -89,18 +67,6 @@ program.down(5);
program.write('Hi again!');
program.bg('!black');
program.feed();
program.getCursor(function(err, data) {
if (!err) {
program.write('Cursor is at: ' + data.x + ', ' + data.y + '.');
program.feed();
}
program.charset('SCLD');
program.write('abcdefghijklmnopqrstuvwxyz0123456789');
program.charset('US');
program.setx(1);
});
```
## High-level Documentation