# Input-\>Keyobard binding in c++?

**URL:** <https://forums.unrealengine.com/t/input-keyobard-binding-in-c/299950>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 26, 2014, 9:18pm UTC](https://forums.unrealengine.com/t/input-keyobard-binding-in-c/299950 "2014-11-26T21:18:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fronit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fronit](https://forums.unrealengine.com/u/Fronit)\
**Post date:** [November 26, 2014, 9:18pm UTC](https://forums.unrealengine.com/t/input-keyobard-binding-in-c/299950/1 "2014-11-26T21:18:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [November 26, 2014, 9:30pm UTC](https://forums.unrealengine.com/t/input-keyobard-binding-in-c/299950/2 "2014-11-26T21:30:40Z")

</div>

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](https://docs.unrealengine.com/latest/INT/Videos/Player/index.html?series=PLZlv_N0_O1gb5xvsc7VM7pfoRAKLuIcFi&video=b_vModa3AiM)

Cheers

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_69b87708](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_69b87708](https://forums.unrealengine.com/u/anonymous_user_69b87708)\
**Post date:** [November 18, 2015, 3:51pm UTC](https://forums.unrealengine.com/t/input-keyobard-binding-in-c/299950/3 "2015-11-18T15:51:05Z")

</div>

dead link.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [November 18, 2015, 6:50pm UTC](https://forums.unrealengine.com/t/input-keyobard-binding-in-c/299950/4 "2015-11-18T18:50:46Z")

</div>

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 (&).
