From c26e360145e3aa556e9ebb6c43d797cc524e19dc Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 20 Oct 2014 07:02:44 +0400 Subject: [PATCH] some minor tweaking... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/keyboard.js | 5 +++++ ui (gen4)/ui.js | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui (gen4)/lib/keyboard.js b/ui (gen4)/lib/keyboard.js index 8d64a9f6..edac68ca 100755 --- a/ui (gen4)/lib/keyboard.js +++ b/ui (gen4)/lib/keyboard.js @@ -246,6 +246,9 @@ function normalizeModifiers(c, a, s){ * XXX check do we need did_handling here... * XXX BUG explicitly given modes do not yield results if the pattern * does not match... + * 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... */ var getKeyHandlers = module.getKeyHandlers = @@ -545,6 +548,8 @@ function getKeyHandlers(key, modifiers, keybindings, modes, shifted_keys, action * * NOTE: The handler will be called with keybindings as context (this). * NOTE: handlers found in actions will be called with the actions as context. + * NOTE: only for handlers found in actions, if the alias ends with '!' + * then event.preventDefault() will be called before the handler. * NOTE: adding a key to the ignore list has the same effect as returning * false form it's handler in the same context. * NOTE: actions,the last case, are used for alias referencing, they will diff --git a/ui (gen4)/ui.js b/ui (gen4)/ui.js index 1df142fd..6dd403af 100755 --- a/ui (gen4)/ui.js +++ b/ui (gen4)/ui.js @@ -90,10 +90,7 @@ module.GLOBAL_KEYBOARD = { 'ctrl+shift': 'F5', // XXX testing... - ctrl: function(){ - event.preventDefault() - a.reverseImages() - }, + ctrl: 'reverseImages!', }, P: { 'ctrl+shift': 'F12',