Cancelling Input Rebinding with more than one input or an Input Action

I want create simple input rebinding for my game and be able to cancel the rebinding also with the backspace key, but .WithCancelingThrough is overriding it’s previous call’s input instead of adding it.

rebindOperation = actionReference.action.PerformInteractiveRebinding()
    .WithCancelingThrough("*/{Cancel}")
    .WithCancelingThrough("<Keyboard>/backspace") // overrides the previous line
    .OnMatchWaitForAnother(0.1f)
    .OnComplete(OnFinish)
    .OnCancel(OnFinish)
    .Start();

It also seems to be impossible to set the WithCancelingThrough to “UI/Cancel” from an action map.

How to do this properly?

Yeah, that should indeed be a list, not just a single binding.

Don’t think there’s a way to achieve this other than by copypasting RebindingOperation and applying the change yourself. Not a difficult change but yeah, having to customize the code isn’t great.

Solved it by using a OnPotentialMatch callback

rebindingOperation = action.PerformInteractiveRebinding(BindingIndex)
    .WithCancelingThrough("*/{Cancel}")
    .OnPotentialMatch(CancelOnBackspace)
    .OnMatchWaitForAnother(0.1f)
    .OnComplete(OnFinish)
    .OnCancel(OnFinish)
    .Start();

void CancelOnBackspace(InputActionRebindingExtensions.RebindingOperation operation)
{
    if (operation.selectedControl.path == "/Keyboard/backspace") operation.Cancel();
}