UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[BUG] Unity UI InputField Not Receiving Text Input

Open vmohan7 opened this issue 3 years ago • 4 comments

Describe the bug I followed the documentation in order to setup browser input to be handled by the Unity UI System. Mouse input successfully works; however I am unable to get Text input to work despite the fact that Keyboard input is coming in from the browser and I can detect it with Keyboard.current from the Input System.

To Reproduce

  1. Create a Unity Canvas
  2. Follow Documentation to make sure mouse input works succesfully : https://github.com/Unity-Technologies/UnityRenderStreaming/blob/develop/com.unity.renderstreaming/Documentation~/browser_input.md
  3. Create a InputField GameObject
  4. Using Remote Mouse click on InputField to select the field and get the cursor
  5. Start Typing and see no input

Expected behavior

InputField should respond to Keyboard input

Environment (please complete the following information):

  • Windows + Unity Editor
  • Render Streaming : 3.1.0-exp.1
  • Input System : 1.0.2

vmohan7 avatar Oct 03 '21 00:10 vmohan7

@vmohan7 Sure, we are updating the implementation of the input. The issue might be fixed this timing.

karasusan avatar Oct 12 '21 05:10 karasusan

memo: URS-349

karasusan avatar Nov 09 '21 02:11 karasusan

I reproduced this issue and understood this problem is difficult to solve... InputField class uses the event instance from Event.PopEvent method to detect keyboard event. But the event instance don't have intended keycode when typing keyboard remotely. 😞

karasusan avatar Nov 25 '21 03:11 karasusan

Ah darn. Was hoping to get it out of the box :( For now, I implemented a work around to force the input into the input field, but not exactly ideal without basically duplicating all the functionality of the InputField

vmohan7 avatar Nov 27 '21 03:11 vmohan7

Is there any progress of this problem? When this problem can be fixed? 😞 Thanks

Minamiyama avatar Dec 16 '22 00:12 Minamiyama

There is no progress, unfortunetelly. Sorry for bothering.

karasusan avatar Jan 11 '23 02:01 karasusan

Is there any progress? it's been two years. Or could you recommend any workaround allowing me to properly receive text input. thanks.

tete1030 avatar Mar 30 '23 09:03 tete1030

@tete1030 No progress. Requires custom implementation in browser and Unity.

kannan-xiao4 avatar Apr 04 '23 06:04 kannan-xiao4

InputFieldBridge.zip

Here is my own implementation to force inputs into an input field. Add this as a component under InputReceiver and assign the reference to it. This doesn't support numpads, so if anyone wants to improve this, feel free too. I'm also sure there is a better way to code this without having to use m_HeldKeys.

JohnnyNgo avatar Apr 11 '23 18:04 JohnnyNgo

@JohnnyNgo Thanks for contribution!

Does anyone try this implementation?

karasusan avatar Apr 18 '23 05:04 karasusan

@JohnnyNgo Thanks, it works!

steoberg avatar May 31 '23 08:05 steoberg

InputFieldBridge.zip

Here is my own implementation to force inputs into an input field. Add this as a component under InputReceiver and assign the reference to it. This doesn't support numpads, so if anyone wants to improve this, feel free too. I'm also sure there is a better way to code this without having to use m_HeldKeys.

thanks seems to be working!!!

GISnick avatar May 31 '23 17:05 GISnick

I am creating the draft PR to make workaround for InputField issue. This fix has some ristriction. For example, IME is not worked. https://github.com/Unity-Technologies/UnityRenderStreaming/pull/920

karasusan avatar Jul 20 '23 09:07 karasusan