neo-neo-bblessed
Version:
A fork of neo-blessed (which is a fork of blessed) with bug fixes and maintenance.
3 lines (2 loc) • 553 B
JavaScript
const r=require("./node"),s=require("./input");function e(t){const n=this;if(!(this instanceof r))return new e(t);t=t||{},t.autoFocus==null&&(t.autoFocus=!1),s.call(this,t),this.on("keypress",function(i,o){if(o.name==="enter"||o.name==="space")return n.press()}),this.options.mouse&&this.on("click",function(){return n.press()})}e.prototype.__proto__=s.prototype,e.prototype.type="button",e.prototype.press=function(){this.focus(),this.value=!0;const t=this.emit("press");return delete this.value,t},module.exports=e;
//# sourceMappingURL=button.js.map