how can i write an custom Input Action in unreal c++

FInputActionBinding CurBinding& = InputComponent->BindAction(TEXT("OpenMenu"), EInputEvent::IE_Released, this, &APlayerControllerGame::ActOnOpenMenu);
CurBinding.bConsumeInput = true;
CurBinding.bExecuteWhenPaused = true;

Where “this” in the example == APlayerController and the implemented method on it ActOnOpenMenu is marked UFUNCTION. Added example of how to set some parameters on the binding but they have defaults . PlayerControllers and Pawns are the common classes to use InputComponents on. If this would be implemented on a UserWidget, forget about InputComponents because they have their own input routing system:

Widget input: It SMELLS