Skip to content

Commit

Permalink
Fix simulated motion controller grab (#11272)
Browse files Browse the repository at this point in the history
Raise boolean input events for simulated motion controller grab

Co-authored-by: Kurtis <kurtie@microsoft.com>
  • Loading branch information
jloehr and keveleigh authored Dec 6, 2022
1 parent 6ceb3b5 commit e71f2c6
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,17 @@ internal void UpdateState(SimulatedMotionControllerData motionControllerData)
break;
case DeviceInputType.GripPress:
case DeviceInputType.TriggerPress:
Interactions[i].FloatData = motionControllerData.ButtonState.IsGrabbing ? 1 : 0;
Interactions[i].BoolData = motionControllerData.ButtonState.IsGrabbing;
if (Interactions[i].Changed)
{
CoreServices.InputSystem?.RaiseFloatInputChanged(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction, motionControllerData.ButtonState.IsGrabbing ? 1 : 0);
if (Interactions[i].BoolData)
{
CoreServices.InputSystem?.RaiseOnInputDown(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction);
}
else
{
CoreServices.InputSystem?.RaiseOnInputUp(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction);
}
}
break;
case DeviceInputType.Menu:
Expand Down

0 comments on commit e71f2c6

Please sign in to comment.