I need a little bit more info on the Enhanced Input Component

Hi there, I’m using the new Enhanced Input Component and binding the inputs in c++.
I’ve got all of the movement and everything working but I’m confused as to how to get a “press and release” action to work.

When I press down the right mouse button, I want to zoom in, and when I release it I want to zoom back out. I can handle the actual zooming and everything but how would I go about setting up that sort of input.

Here’s a picture of what I have so far, am I on the right track?

and here’s the C++ code I’m using to bind the action:

if (ZoomAction)
		{
			PlayerEnhancedInputComponent->BindAction(ZoomAction, ETriggerEvent::Started, this, &APB_PlayerCharacterPrimary::ZoomCamera);
			PlayerEnhancedInputComponent->BindAction(ZoomAction, ETriggerEvent::Completed, this, &APB_PlayerCharacterPrimary::ZoomCameraOut);
		}

It seems that the ‘Released’ trigger I have set up in the editor fires ‘ETriggerEvent::Completed’ , is this the correct way of making this sort of input?

Thanks for any help!

Yep you are right, Pressed/Released → Started/Completed is the right combination. :slightly_smiling_face:

1 Like

Thank you!

No problem, i know is an old thread and probably you already figured out this, but i think is important to know for all the other people that come and see it, Enhanced Input is not so immediate to understand at the beginning.