-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
WIP: US-International Keyboard Deadkeys #1907
base: master
Are you sure you want to change the base?
Conversation
@sergiomb2 Can you give me some more information:
So i can try to reproduce the problem |
I use PT_pt keyboard layout , in pt layout we have 5 dead keys but I only use 4 (`, ´, ~, and ^) I changed the following code and work perfectly with Firefox browser , with google chrome don't I use Linux Fedora 39 KDE, novnc 1.4.0
|
I'm afraid I don't understand the principle here. The code looks to be simply assuming one specific layout as it is just hard-coding what symbol is expected from a specific physical key? |
Using the keyboard layout API might be an option. They seem to have started defining how dead keys should be reported: https://wicg.github.io/keyboard-map/#dead-and-combining It's not supported by Firefox yet, though. |
Never mind. It seems Safari has firmly said no to that API because of fingerprinting concerns. And Firefox seem to be of the same opinion: |
Yeah that is true, Now it assumes keyboard layout is us-international. |
I have no longer time to work on this for at least a month. |
if(key === "Dead" ){ | ||
return getDeadKeysym(evt); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to me that key==="Dead"
just works in Firefox and not in Chrome .
In firefox I got all accents working perfectly .
But I'd like use one electron app , because I can use ctrl + key , how we catch dead keys in chrome as it here ?
Strange i can not really reproduce that. for me it works on
I do see a difference in output between linux, and windows. but for a non text text input, for linux (wayland) . see the same result for google-chrome as firefox. I test it with test.html I had to add .csv to be allowed to upload it. so you have to remove the .csv extension. I test with keyboard layout: us-international with dead keys. |
yes , thank you, I got all accents working perfectly on chrome 130.0 , from my chromebook . |
Curiously, with electron 31.7.5 based on Chromium v126.0.6478.234, it doesn't work, or rather there are things that seem to already work but in general it doesn't work, it seems to me that this change requires very updated versions ? |
This proof of concept for Solution 1 for issues #350
Solution 1, guess dead key from event.code etz.
This has the problem this depends on they keyboard layout. which is unknown to the browser.
But:
You only have to do this for Dead Keys, not all keys
there lots of overlap between keyboard layouts, dead keys list
when the overlap, it works for both
If the conflict you can't resolve it
This is not a perfect solution. But you can get it to work for most used keyboard layouts, with deadkeys.
Which might be better the Nothing.
I have a working POC that works for us international keyboard layout with:
XK_dead_grave: `
XK_dead_diaeresis: "
XK_dead_acute: ´
XK_dead_circumflex: ^
XK_dead_tilde: ~