mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-10 19:16:20 +00:00
add ignoreLocked option to Screen.
This commit is contained in:
parent
ba3f0e0815
commit
6f91361197
@ -172,6 +172,9 @@ The screen on which every other node renders.
|
||||
- **dump** - dump all output and input to desired file. can be used together
|
||||
with `log` option if set as a boolean.
|
||||
- **debug** - debug mode. enables usage of the `debug` method.
|
||||
- **ignoreLocked** - Array of keys in their full format (e.g. `C-c`) to ignore
|
||||
when keys are locked. Useful for creating a key that will *always* exit no
|
||||
matter whether the keys are locked.
|
||||
|
||||
##### Properties:
|
||||
|
||||
|
@ -281,6 +281,8 @@ function Screen(options) {
|
||||
this.autoPadding = options.autoPadding;
|
||||
this.tabc = Array((options.tabSize || 4) + 1).join(' ');
|
||||
|
||||
this.ignoreLocked = options.ignoreLocked || [];
|
||||
|
||||
this.dattr = ((0 << 18) | (0x1ff << 9)) | 0x1ff;
|
||||
|
||||
this.renders = 0;
|
||||
@ -550,7 +552,9 @@ Screen.prototype._listenKeys = function(el) {
|
||||
// checks to make sure grabKeys, lockKeys, and focused
|
||||
// weren't changed, and handles those situations appropriately.
|
||||
this.program.on('keypress', function(ch, key) {
|
||||
if (self.lockKeys) return;
|
||||
if (self.lockKeys && !~self.ignoreLocked.indexOf(key.full)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var focused = self.focused
|
||||
, grabKeys = self.grabKeys;
|
||||
|
Loading…
x
Reference in New Issue
Block a user