action event. docs.

This commit is contained in:
Christopher Jeffrey 2013-07-12 05:39:22 -05:00
parent ac1658ffd0
commit 5dcb8f3200
2 changed files with 7 additions and 8 deletions

View File

@ -35,14 +35,12 @@ The main functionality is exposed in the main `blessed` module:
var blessed = require('blessed')
, program = blessed();
program.on('keypress', function(ch, key) {
if (key.name === 'q') {
program.clear();
program.disableMouse();
program.showCursor();
program.normalBuffer();
process.exit(0);
}
program.key('q', function(ch, key) {
program.clear();
program.disableMouse();
program.showCursor();
program.normalBuffer();
process.exit(0);
});
program.on('mouse', function(data) {

View File

@ -2216,6 +2216,7 @@ List.prototype.add = function(item) {
if (this.mouse) {
item.on('click', function(data) {
if (self.items[self.selected] === item) {
self.emit('action', item, self.selected);
self.emit('select', item, self.selected);
return;
}