-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Cannot type dead keys (accented characters) or use Input Method Editor on a LineEdit exported to HTML #45904
Comments
@Calinou Spanish layout. I have been testing accessing the HTML page on different computers and these are the results:
This seems to be OS related and independent of the browser, because all tested browsers fail in the affected systems, and none of the browsers tested on the non-affected systems fail. |
This is due to limitation in web standards. |
Thanks for your reply but I don't understand how this is related to web standards. Other keys work OK, and on Windows even dead keys work... |
Because different OSes uses different methods for handling dead keys, and because composition events are not fired on canvas. https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent |
To expand a bit on this...
That said, if anyone finds a reliable way to detect special keys inserted via dead keys from a |
Maybe you could use KeyboardEvent.code instead of KeyboardEvent.key ? This is the output when typing
While on Chrome on Windows I get this:
This is why the issue does not affect Windows, because in this case KeyboardEvent.key contains the composed output (í instead of i) Do you have a way to combine several keys (KeyboardEvent.code) into the corresponding output taking into account the user keyboard layout? (note that the KeyboardEvent.code returns the physical key pressed, independently of the keyboard layout). |
Exactly, that's why we can't use |
Physical scancodes were added to 4.0 by #18020. These are intentionally separate from non-physical scancodes as you ideally want to support both as a game engine. |
Looks like this is still happenning on Godot 4.0 and 4.0.1 |
So, I've being studying this problem for some days. Like @Faless said, I don't think there is a way to make canvas use CompositionEvents. I've tried a lot of ways, but none of them worked. That being said, looks like the option we have is to use a hidden input, as commented by Fabio. I made a little proof of concept here to test this out, and it looks like it works fine, just has to be polished (the code right now is absolutely awful). The gif below shows how it is working right now. That being said, does it look like this is a viable option? |
Not sure whether or not this is related but when I export a project to HTML5
(Update: noticed the title was updated to include IME, so yes, it's related) |
Maybe we can make a web only function like From my point, it's important to make web export able to use IME, but with the current web standard it's not possible to achieve it with any other approach. |
There is a pending PR (linked above) implementing this using a hidden element: #79362 . |
Godot version:
Godot v3.2.3
OS/device including version:
MacOS exporting to HTML
Issue description:
Cannot type dead keys (needed to enter accented characters) inside a LineEdit which has been exported to HTML.
Steps to reproduce:
https://origamer.itch.io/ortografiator
Minimal reproduction project:
Any project with a LineEdit.
The text was updated successfully, but these errors were encountered: