mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-10 19:16:20 +00:00
add mouse test.
This commit is contained in:
parent
0c6695d236
commit
3e6a89099e
26
test/program-mouse.js
Normal file
26
test/program-mouse.js
Normal file
@ -0,0 +1,26 @@
|
||||
var blessed = require('../')
|
||||
, program = blessed();
|
||||
|
||||
// program.setMouse({
|
||||
// allMotion: true,
|
||||
// //utfMouse: true
|
||||
// urxvtMouse: true
|
||||
// }, true);
|
||||
|
||||
program.alternateBuffer();
|
||||
program.enableMouse();
|
||||
program.hideCursor();
|
||||
|
||||
program.on('mouse', function(data) {
|
||||
program.cup(data.y, data.x);
|
||||
program.write(' ', 'blue bg');
|
||||
program.cup(0, 0);
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
program.key(['q', 'escape', 'C-c'], function() {
|
||||
program.showCursor();
|
||||
program.disableMouse();
|
||||
program.normalBuffer();
|
||||
process.exit(0);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user