- Home /
WebGL player eating keystrokes
I've built this player, running in Chrome, but I'm putting it in a 'wrapper' HTML page that should be accepting keystrokes for normal text/numeric fields. I can focus them, I see the cursor there, but no keys are responding: no characters are accepted into these fields, backspace and delete don't work, dragging does not highlight any existing values. What's going on?
Answer by Lloyd_RedironLabs · Dec 31, 2015 at 12:12 AM
Linking this over for closure, and so the next search person can find the answer that worked for us.
#if !UNITY_EDITOR && UNITY_WEBGL
WebGLInput.captureAllKeyboardInput = false;
#endif
Answer by RSoj · Jun 25, 2015 at 03:22 PM
All of your keystrokes are being eaten by the WebGL player (emscripten).
Basically you need to provide own input element for the player, because it listens to window events in default. There is no other solution to this that I'm aware of, you must implement it yourself.
There is solution, but it works only in version 5.0.1. If you're building in 5.1.1, you can use a workaround from my answer to question on same topic.
Your answer
Follow this Question
Related Questions
Open standard context menu in WebGL on right click 0 Answers
Shift + KeyCode.Equals works in Unity Editor but not on WebGL build 0 Answers
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
Keyboard and Controller Input Not Working in WebGL 1 Answer
New input system doesn't work on webgl build for android 0 Answers