add the experimental 'ALL' keyboard pattern, not for production use yet...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-11-07 23:34:08 +03:00
parent 6a1d0cf0db
commit d11bf935d3
2 changed files with 11 additions and 1 deletions

View File

@ -300,6 +300,8 @@ function dropRepeatingkeys(handler, max_rate){
* XXX should action handler support event.stoppropagation()???
* ...at this point I'm not sure it is needed as it will not affect
* the keyboard handlers, it will preven further JS event handlers...
* XXX this also supports the experimental 'ALL' key name that matches
* all the keys, needs more work, not for production use...
*/
var getKeyHandlers =
module.getKeyHandlers =
@ -376,8 +378,11 @@ function getKeyHandlers(key, modifiers, keybindings, modes, shifted_keys, action
modifiers = modifiers.replace(/\+?shift/i, '')
} else if(chr in bindings){
var handler = bindings[chr]
} else {
} else if(key in bindings) {
var handler = bindings[key]
// XXX experimental...
} else {
var handler = bindings['ALL']
}
// alias...

View File

@ -2309,6 +2309,11 @@ var drawer = require('lib/widget/drawer')
// This will wrap the actions adding a contextual .preventClosing() method,
// if called it will prevent the list from closing on open event and give
// the user control over when to close the base list...
//
// XXX this may be a source for race conditions...
// scenario:
// - an action is run while a menu runs a state changing action
// - state restoration will overwrite the effects fo the BG action
var makeActionLister = function(list, filter, pre_order){
pre_order = typeof(filter) == typeof(true) ? filter : pre_order
filter = typeof(filter) == typeof(true) ? null : filter