MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Input System raises OnInputChanged every frame for pressed buttons

Open luis-valverde-ms opened this issue 7 years ago • 4 comments

Overview

It seems that IMixedRealityInputSystem.RaiseOnInputPressed() is meant to be raised every frame a binary input (e.g. binary button) is down: see MouseController.Update and GenericJoystickController.UpdateButton. The event it is triggering though should only be raised on input changes.

I don't think we should be broadcasting the current state of an input every frame. Users should instead rely on the input down/up events and access directly the input source/controller if they need to know the current state.

We should substitute the input pressed interface with something like RaiseOnFloatInputChanged() that is called to report changes to float input values. Note that WindowsMixedRealityController is already using RaiseOnInputPressed to report changes to trigger button values.

luis-valverde-ms avatar Mar 28 '19 12:03 luis-valverde-ms

This feels like event overload. i definitely agree with @luis-valverde-ms that this should be fixed.

david-c-kline avatar Apr 02 '19 22:04 david-c-kline

@luis-valverde-ms is there a perspective on how long this would take to fix? It would be great to have a fix for this in rc1, but if its going to take a lot of time it may slip to rc2.

chrisfromwork avatar Apr 02 '19 22:04 chrisfromwork

Opened PR for this: #3787

luis-valverde-ms avatar Apr 03 '19 14:04 luis-valverde-ms

I believe this is done (by #3787) so closing this out.

wiwei avatar Apr 04 '19 18:04 wiwei