unity webgl keyboard input is not working

by Muhammad Faizan Khan   Last Updated February 11, 2019 08:13 AM

I have a page with unitywebgl and some other extra input controls like for number and name but the problem is, the other html input control are not getting input from keyboard. After searching i found

By default, Unity WebGL will process all keyboard input send to the page, regardless of whether the WebGL canvas has focus or not. This is done so that a user can start playing a keyboard-based game right away without the need to click on the canvas to focus it first. However, this can cause problems when there are other HTML elements on the page which should receive keyboard input, such as text fields - as Unity will consume the input events before the rest of the page can get them. If you need to have other HTML elements receive keyboard input, you can change this behavior using the WebGLInput.captureAllKeyboardInput property.

But the problem is that I don't want to completely disable the input for unitywebGL. So I found another link but the problem is i don't where should I implement the solution?

Any help ?

Tags : unity webgl


Related Questions



Unity WebGL responsive

Updated May 02, 2016 08:05 AM

Array of script class references in inspector

Updated April 29, 2015 21:05 PM

How to display full website in Unity WebGL?

Updated May 10, 2017 06:13 AM