action event. docs.
This commit is contained in:
parent
ac1658ffd0
commit
5dcb8f3200
14
README.md
14
README.md
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue