OscarGodson / jKey

Key shortcuts made simple
http://oscargodson.github.com/jKey/
185 stars 40 forks source link

Fixed problem with "tab+shift,tab" triggering on shift. #24

Closed NigelThorne closed 4 years ago

NigelThorne commented 11 years ago

Also only triggers callback once if matched.

Note: "tab,tab+shift" will only ever call with "tab" as it is a subset and gets checked first.

dsteppeler commented 10 years ago

I think I have almost the same problem. I added

$(document).jkey('alt+shift+f',function() {
      customFunction();
});

The first time it is triggered correctly on "alt+shift+f". But after that "alt+shift" will also trigger the function. For testing I added another key ("alt+shift+f+u"). The same effect: first time the function triggers on "alt+shift+f+u" as expected. After that it will trigger in "alt+shift+f".

So it seems that after the first time usage of the key code the last key in the chain gets lost.

In order to be complete: I have another key code on "alt+s" which works fine and doesn't have the same effect. The problem occurs on latest Firefox, Mac OSX Mavericks.

NigelThorne commented 10 years ago

Try my fork. See if it works.

dsteppeler commented 10 years ago

It did not work for me, the problem remains.

NigelThorne commented 10 years ago

try now.

dsteppeler commented 10 years ago

Unfortunately it still doesn't work. I was trying to use this key code combination in order to activate/deactivate fullscreen mode in browser. I also tested if "alt+shift" causes the browser to exit fullscreen mode even if the key code is deactivated, but it doesn't. So it seems to be a problem of the script.