TexMeshPro, Keyboard Input, TMP_InputField and Canvas UI Generally

I have been trying to get canvas input working. I have basically begun manually doing GetComponent (and related interfaces) on the target object acquired from the EnhancedSpatialPointerSupport.GetPointerState() interface similar to the SpatialUI Sample. I have some UI with a TMP_InputField on a canvas, and while I can get the field to select, I am having issues getting the keyboard to show up. On looking at the source for TMP_InputField, I found the shouldHideSoftKeyboard does not use the set value unless it is a specific platform, and VisionOS does not seem to be handled in the very long switch that defaults to “= false”.

Is there a preview TMP package that I can pull for this support, or should I be checking for specific fields in my code and manually calling TouchScreenKeyboard.Open?

Moreover, I’ve seem some very vague recommendations to use CanvasUI, but I do not see any concrete examples for configuring this use case. Is what I am doing, checking for the various event handlers etc… a sane thing to do?

On a second glance, I see that TouchScreenKeyboard.isSupported actually returns false. Is there an alternate way to open the keyboard on this device?

I found some other replies referring to the PolySpatialInputActions ActionMap they include by hooking it up through a InputSystemUIInputModule, and using the SpatialPointerDevice via the Input System Package settings under Project Settings. I did that stuff, and it still does not work. I would prefer not to do a bunch of type checking and GetComponent<>ing every frame, so some guidance there would be nice.

Just as well, the keyboard still does not work on input fields, so that question still stands.

Keyboard support is something that is planned, but requires actual Unity itself to handle and not the PolySpatial packages. I have no current ETA on that though at this time.

1 Like