Input->Keyobard binding in c++?

Hi, what’s the equivalent expressing for “Input->“w” Release/Pressed event (Blueprint)” in c++?

Hey -

You first want to make sure you assign the input button commands you want in Edit->Project Settings inside the editor. Then in visual studios you can define the code that associates with each command. This video goes over how to code the movement for a character based on the buttons set in the editor:

https://docs.unrealengine.com/latest/INT/Videos/Player/index.html?series=PLZlv_N0_O1gb5xvsc7VM7pfoRAKLuIcFi&video=b_vModa3AiM

Cheers

dead link.

Hey -

This post is roughly a year old and this original link no longer works. This current video can be used to setup the input inside the editor:

Once the inputs have been set in the editor you can edit the SetupPlayerInputComponent(class UInputComponent* InputComponent) function of the class you want to give input commands for. In the following example code it is assumed that I have set the name of my axis mapping in the editor to Turn: InputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput);
In this case whenever the button associated with Turn in the editor is pressed it will call the function APawn::AddControllerYawInput. This can be done to setup any button/functionality in your own class by using the name of the binding in quotes and the function that is to be called following the ampersand (&).