-
Notifications
You must be signed in to change notification settings - Fork 29
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
Azerty not working #32
Comments
That's probably because the scancode is used. |
Keyboard work in Atom Editor. |
OK, let me see if I can find the issue, as the code that processes keyboard events were taking from Atom. |
Ok. Feel free to ask me to test some modification. |
I try to replace keydown event by keypress event. |
Indeed the keypress event is the only way to go. AFAIK it's not possible to properly handle localized or punctuation characters via the keydown event. Unfortunately, some special keys like or do not fire the keypress event. So we need to keep both. I propose to keep keydown for the special keys and then handle others with the keypress event. @coolwanglu: you don't need a physical AZERTY keyboard to test. It's depend on which system you are but you can easily change the layout. |
@q12321q Is there a library for this? |
for what? |
Translate keycode to localized characters. |
Unfortunately, no. There're many attempts but all of them seems clumsy/kludgy and not exhaustive. |
And here we are lucky because keycode are also local to every browser. For a same character, you can have different keycode in chrome and firefox... https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode |
I updated the fork (https://github.com/q12321q/neovim-e) with the implementation of my previous comment:
@coolwanglu what do you think? |
Some readings: It won't be that easy to solve... |
@q12321q Indeed I switched 'keypress' to 'keydown' before, just to handle special characters. To use both events, we need to make sure that each physical key press is handled only once by either handler, and we might need to test on different platforms.
|
I start to think that the keypress solution is maybe a dead end... |
Indeed. That's quite a mess. |
OK, I did some search again and I found no perfect solution. Atom has the same issues and like us have no clean solution. atom-keyboard-localization fix a lot of things but has the major drawback to maintain a non exhaustive tables of key mappings and the need to manually define on which keyboard you are. But we have a hope: DOM3 with the implementation of the key value in the keydown event: In the mean time if you want, we can implement something like atom do:
You'll always have the correct character when typing a text and we could only have limitations on key combinations. Thoughs? |
I don't know how long we should wait for KeyboardEvent. I remember our So it depends on whether you want this feature in the near future. |
Of course it could take at least several months or years to wait for the KeyboardEvent.key feature. Dev is always longer than we think but it's good to know that we'll have a real solution. Today, neovim-e is unusable on non-US keyboard: the ':' is not available. |
@q12321q It started as a simply POC, or a toy :). But I'm happy to find that people started to report bugs and send PRs. While I will have limited time on this project, I'd love to make fixes and merge PRs. |
Azerty keyboard dont work.
Letter press is correctly print in screen, but all symbol (number, ponctuation, ...) is not from azerty keyboard.
The text was updated successfully, but these errors were encountered: