diff --git a/README.md b/README.md index ebd49e1..88f6f37 100644 --- a/README.md +++ b/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) { diff --git a/lib/widget.js b/lib/widget.js index e10c42d..66aac77 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -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; }