I implemented a simple InputAction asset for my project and the Actions worked well in Unity with Mouse and Keyboard. When I started using this on my Samsung Galaxy S10e though, I started getting an exception. The exception was the following (sorry if I made a mistake copying from my console, I cannot copy-paste):
“Cannot read control ‘/Touchscreen1/pressure’ from STAT with format TOUC; device ‘Touchscreen:/Touchscreen1’ expects format TSCR.”
This exception throw comes from InputControlExtensions.cs Line 502-503. The whole touchscreen would not work because only “pressure” could not be processed apparently…
For now, I just changed the exception throw to return null instead. It made my touchscreen work again. I don’t see the value of “Pressure” changing in the Input Debug window but I suppose this is normal with my change.
Even though I have a temporary fix, what is really the problem ? Am I working with a feature that is not ready yet or is this a problem only with specific device not supporting “Pressure” ??
I saw in Touchscreen.cs Line 12 that you guys plan on adding a property for the support of “Pressure”:
////TODO: property that tells whether a Touchscreen supports pressure
So I assume I should you a device that supports it for now…
Thanks for helping, this new input system with be great once finished.
Eric
Indeed, that one has surfaced on various platforms (here, for example) and will get looked at shortly. The code isn’t dealing with touch events correctly and tries reading the data out from the event in a way that won’t work in this case. Hope to have a fix soon.
I appear to be getting the same issue while running Preview 6.
Running on a Samsung Galaxy TabA works fine, but running on an S20 yields the following error, as above.
nvalidOperationException: Cannot read control '/Touchscreen1/pressure' from STAT with format TOUC; device 'Touchscreen:/Touchscreen1' expects format TSCR
Providing a screengrab of my current input actions for clarity.
Yes I managed to resolve this by deleting the input action map and recreating it. It was originally created under the beta packages, so there may have been some corruption using it in the official v1.0.0 release.
Unity 2019.4.20f1, Input System 1.1.1, Android Player.
According to the issue-tracker, this problem should have been fixed a long time ago. Unfortunately, I’m still seeing the issue. Is there another fix in flight?
I’m seeing the InvalidOperationException issue on the following devices:
Device Model: LENOVO/Lenovo TB-X606X/X606X
Android OS 10 / API-29 (QP1A.190711.020/TB-X606X_USR_S300378_2109090007_V9.56_BMP_ROW)
LGE/LM-G900TM/mcaymanlm
Android OS 10 / API-29 (QKQ1.200614.002/6883100210801)
samsung/SM-G991U/o1q
Android OS 12 / API-31 (SP1A.210812.016/G991USQU4BUK7)
Xiaomi/M2101K6G/sweet
Android OS 11 / API-30 (RKQ1.200826.002/V12.0.5.0.RKFEUOR)
Xiaomi/M2004J19C/galahad
Android OS 11 / API-30 (RP1A.200720.011/V12.5.1.0.RJCEUXM)
Xiaomi/Redmi Note 9 Pro/joyeuse
Android OS 11 / API-30 (RKQ1.200826.002/V12.0.4.0.RJZMIXM)
Xiaomi/M2101K9AG/courbet
Android OS 11 / API-30 (RKQ1.200826.002/V12.5.5.0.RKQEUXM)
InvalidOperationException: STAT event with state format TOUC cannot be used with device 'Touchscreen:/Touchscreen1'
UnityEngine.InputSystem.InputDevice.set_hasDontResetControls (System.Boolean value)
UnityEngine.InputSystem.Users.InputUser.OnEvent (UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr, UnityEngine.InputSystem.InputDevice device)
System.Action`2[T1,T2].Invoke (T1 arg1, T2 arg2)
UnityEngine.InputSystem.Utilities.DelegateHelpers.InvokeCallbacksSafe[TValue1,TValue2] (UnityEngine.InputSystem.Utilities.CallbackArray`1[System.Action`2[TValue1,TValue2]]& callbacks, TValue1 argument1, TValue2 argument2, System.String callbackName, System.Object context)
UnityEngine.InputSystem.InputManager.OnUpdate (UnityEngine.InputSystem.LowLevel.InputUpdateType updateType, UnityEngine.InputSystem.LowLevel.InputEventBuffer& eventBuffer)
UnityEngine.InputSystem.LowLevel.InputUpdateDelegate.Invoke (UnityEngine.InputSystem.LowLevel.InputUpdateType updateType, UnityEngine.InputSystem.LowLevel.InputEventBuffer& eventBuffer)
UnityEngine.InputSystem.LowLevel.NativeInputRuntime+<>c__DisplayClass7_0.<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType updateType, UnityEngineInternal.Input.NativeInputEventBuffer* eventBufferPtr)
UnityEngineInternal.Input.NativeUpdateCallback.Invoke (UnityEngineInternal.Input.NativeInputUpdateType updateType, UnityEngineInternal.Input.NativeInputEventBuffer* buffer)
UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeUpdateCallback:Invoke(NativeInputUpdateType, NativeInputEventBuffer*)
Please see my post right above this one. Is there anything I can do fix/workaround this issue or get you to look at the issue? We have several players that report input just stops working mid-game for no apparent reason.
Hi Rene, sorry for being stubborn on the issue. It’s a big deal for me, because it affects quite a few players.
Please see m y post right above . Is there anything I can do fix/workaround this issue or get you to look at the issue? We have several players that report input just stops working mid-game for no apparent reason.