-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
HTML5 exported game in iframe loses keyboard input after unfocus and attempt to refocus #55017
Comments
Honestly this error is probably your fault. |
One way to fix this is to go into game.js (the file with the Engine class) and remove every instance of |
cc @Faless |
Is it working as expected in |
Yes. It works as intended. I installed 3.3 from here and remade the InputLogger (attached zip) and exported the project in HTML5 and keyboard input works again each time you refocus the iframe. |
Sorry for the Google translator. Not only in C#. I observe the same bug in my game written in gdscript. |
Yep, this is likely a regression from #52812 |
I noticed that in Firefox, if the game has a clickable button to capture the cursor, the cursor gets stuck captured and pressing escape wont free it like it normally should. However F5 refreshes the page and frees it. That's probably more of a Firefox bug though. |
I had to export with v3.3.3 because of a regression bug in 3.4 (godotengine/godot#55017). This means we lose the PWA features but it's okay because it didn't really work that well. So I might need to export for android anyway.
Godot version
v3.4-stable_mono
System information
Windows 10, GLES2
Issue description
The canvas fails to regain capture input after clicking out of the iframe that it's located in. It only works the first time when you have 'Focus Canvas On Start' enabled. When the page loads, your input is captured and everything works fine but if you click off the iframe that the game is located in and try to click back in, your keyboard input doesn't work. Clicks work but keyboard input doesn't.
Attached is a video trying to show this.
2021-11-15.20-10-18.mp4
Steps to reproduce
I have created a very simple project that displays a label when you press E. If you run it in Godot editor, it works fine.
To run the exported game, go into /export and if you have python 3.x installed, run
python -m http.server
orpy -3 -m http.server
Go to localhost://[the port that came from python output] in your browser and try to press E. It works. Now click out of the iframe and click back in it. It doesn't work.
The main script is located in res://Notification.cs
Minimal reproduction project
InputLogger.zip
The text was updated successfully, but these errors were encountered: