Unity's "New Input System:" Cancel "PerformInteractiveRebinding" with a Mouse Click

Viewed 28

Is there a way to cancel "PerformInteractiveRebinding" with the click of the mouse?

I'm having some trouble with Unity's "new" input system. What I have works fine until I start keybinding another key, thus activating two "PerformInteractiveRebinding"s at the same time. I pressume that I can implement what I need with an input such as a mouse click, but I don't know the terminology to do it.

Here's what the code contains:

`rebindingOperation = DMovement.action.PerformInteractiveRebinding()`
`.withControlsExcluding("Mouse")`
`.OnMatchWaitForAnother(0.1f)`
`.OnComplete(operation => RebindingComplete())`
`.Start();

Thank you for your interest, and hope you have a good day!

1 Answers

Discovered the terminology! Here's my updated code for anyone needing it:

`rebindingOperation = DMovement.action.PerformInteractiveRebinding()
`    .withControlsExcluding("Mouse")
`    .WithCancellingThrough("/<Mouse>/leftButton/")
`    .OnMatchWaitForAnother(0.1f)
`    .OnCancel(operation => OnCancellation())
`    .OnComplete(operation => RebindingComplete())
`    .Start();

Cheers Gents!

Related