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

Problem with char detection on Danish keyboard #16

Closed
netsi1964 opened this Issue Jun 10, 2012 · 3 comments

Comments

Projects
None yet
3 participants
@netsi1964

netsi1964 commented Jun 10, 2012

When I for instance press "ø" I get this: http://screencast.com/t/6GKvfSg7m

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jun 11, 2012

Contributor

You're right. I get the same thing when using a German keyboard layout. Unfortunately, getting the right keyCode across browsers is a total mess at best and impossible at worst:
http://unixpapa.com/js/key.html

The best bet is usually using keypress. Maybe we should consider not returning a key name for keydown and keyup events at all.

Contributor

daffl commented Jun 11, 2012

You're right. I get the same thing when using a German keyboard layout. Unfortunately, getting the right keyCode across browsers is a total mess at best and impossible at worst:
http://unixpapa.com/js/key.html

The best bet is usually using keypress. Maybe we should consider not returning a key name for keydown and keyup events at all.

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Jun 12, 2012

Member

Instead, we should start collecting keyboard-layout maps for people to use. People can add their own map.

Member

justinbmeyer commented Jun 12, 2012

Instead, we should start collecting keyboard-layout maps for people to use. People can add their own map.

@daffl daffl closed this in 0aaeca0 Jun 15, 2012

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jun 15, 2012

Contributor

In the API documentation you will find a tool that generates an alternate keymap for different keyboard layouts:

http://donejs.com/docs.html#!jQuery.event.key

Since the keyCodes are also different between browsers you need to open it in each browser you want to support and
press the keys that are not mapped correctly. It will generate a mapping that you can copy and provide with your application. Unfortunately there isn't a way to find get the current keyboard layout. The best bet is probably based on the browser language setting (which is unfortunately not very accurate already).

Contributor

daffl commented Jun 15, 2012

In the API documentation you will find a tool that generates an alternate keymap for different keyboard layouts:

http://donejs.com/docs.html#!jQuery.event.key

Since the keyCodes are also different between browsers you need to open it in each browser you want to support and
press the keys that are not mapped correctly. It will generate a mapping that you can copy and provide with your application. Unfortunately there isn't a way to find get the current keyboard layout. The best bet is probably based on the browser language setting (which is unfortunately not very accurate already).

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