Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shift + '?' on german keyboard not working in FF 3.6.13 #4

Open
propercroc opened this issue Jan 21, 2011 · 6 comments
Open

shift + '?' on german keyboard not working in FF 3.6.13 #4

propercroc opened this issue Jan 21, 2011 · 6 comments

Comments

@propercroc
Copy link

$(window).jkey('shift+?',function(){
    console.log('key pressed');
});

Does not work in Firefox 3.6.13 / Mac OS X with a german keyboard. The keyUp-Code that jquery receives when I press the ?-Button is 223. Sadly, I couldnt find any assigned key name at the beginning of the jkey source.

Otherwise, thank you for the good script. Just what I needed.

Michael

@OscarGodson
Copy link
Owner

We would like to add support for other keyboards through a 4th parameter called localization where you can give it a key or a whole entire new set and it'll overwrite the others.

Once I get this working would you be up for sending me a new JSON packet with German keys so I could include a separate directory containing other layouts? :)

@propercroc
Copy link
Author

Of course, gladly. And some other european ones, as well.

@OscarGodson
Copy link
Owner

Great! I'll try to implement that tomorrow, or maybe sometime this week and ping ya again :)

@OscarGodson
Copy link
Owner

So, i finally added it in, but I'm not 100% sure about the syntax. It'd look like this:

$(window).jkey('?',callback,{'?':223})

Or, my suggestion would be to use it like:
var localization = {'?':223,'a':224,'b':225,'c':226}
$(window).jkey('?',callback,localization)
$(window).jkey('a+b,c',callback,localization)

Basically, we setup a var with all the new key mappings and then pass with each call you wanna overwrite it with. What do you think? It's working now and if you think it works I can push an update!

@propercroc
Copy link
Author

Well, one could argue the need of passing in the localization var over and over again, it could be bothering when the locale var is out of scope for instance. I would pass it into the jkey config in some kind of constructor of init method.
Otherwise I think the above is a good idea. Do we have a source to easily find out the key numbers? Is it possible they differ among user agents?
I tried your code as-is without any success.

@propercroc
Copy link
Author

Ah, you can try out here what your keyboard code js has detected, and this also leeds to a new bug, this time in FF. On http://www.webonweboff.com/tips/js/event_key_codes.aspx#instant-test you can test your input. Safari will give back '189', while FF states '0' as keyboard code. Could also be a bug in those script running on webonweboff, though.

Where can I pull the code that enables me to use the upper syntax you suggested? Is it available already or could you send me a patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants