# Bindings keyboard inputs via Delegates fail

**URL:** <https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144>\
**Category:** UI\
**Tags:** Input, unreal-engine, keyboard, delegate, Widget, Blueprint, question\
**Created:** [December 1, 2017, 10:58pm UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144 "2017-12-01T22:58:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [December 1, 2017, 10:58pm UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/1 "2017-12-01T22:58:21Z")

</div>

Hello all, on my project collided with next problem: I want binding UMG button on keyboard key. I spend 8 hours to try fin solution for this simple functional. First i try make like in this post:  
[https://forums.unrealengine.com/filedata/fetch?id=1071105&d=1427206990](https://forums.unrealengine.com/filedata/fetch?id=1071105&d=1427206990). But i don’t find way to call “Get key” nod.  
after that i try use this solution:  
[UMG - Keyboard shortcuts - UI - Unreal Engine Forums](https://answers.unrealengine.com/questions/142832/umg-keyboard-shortcuts.html)  
But get error:

 ![222210-ui.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/d/9/cd9a5b6ba73c853b17049454cab45c090e15ce55.png)

 ![222222-player.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/e/e7e2a3f719cd26f35c0d664a96541516b8c6f617.png)

In my “game” mouse is not available and i want press any key on keyboard and see how my widget button pressed, like in all modern games. Please help me, i very tired try to do this “simple” task. P.S. Sorry for my english.

---

<div class="post-metadata">

**Author:** ![Unzkilled](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unzkilled](https://forums.unrealengine.com/u/Unzkilled)\
**Post date:** [December 1, 2017, 11:06pm UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/2 "2017-12-01T23:06:12Z")

</div>

Sorry dude, but I’m really confused about what you are trying to do. By the way you should bind your key input within your player controller. See this image, it is on player controller, everytime key E is pressed it will trigger the event “Request Mount From Server”:

 ![80649-controllerinput.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/d/89d6877c1f9c153ccaaeb2f3398ceef44cd3ea4f.jpeg)

If you want to bind an event to be called everytime “Esc” is pressed, just right click on the event graph of your player controller and type “Escape”.

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [December 1, 2017, 11:15pm UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/3 "2017-12-01T23:15:32Z")

</div>

you don’t understand me, i have class: player, in this class i have button “E” and i what functional: when i press “E” witget button is pressed or speaking differentl way i whant press witger button via keybord.

---

<div class="post-metadata">

**Author:** ![Unzkilled](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unzkilled](https://forums.unrealengine.com/u/Unzkilled)\
**Post date:** [December 2, 2017, 12:45am UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/4 "2017-12-02T00:45:23Z")

</div>

Just call the same event you call when the widget button is clicked on your keypress event.

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [December 2, 2017, 8:53am UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/5 "2017-12-02T08:53:21Z")

</div>

How? I have input event on my “player” class, how i connect to even click on widget class?

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [December 2, 2017, 8:59am UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/6 "2017-12-02T08:59:22Z")

</div>

![222245-pw.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/1/021916564ea212308c7533ed2acb85e33946274b.png)

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [December 2, 2017, 9:00am UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/7 "2017-12-02T09:00:58Z")

</div>

If someone have simple solution please show me how…

---

<div class="post-metadata">

**Author:** ![User609571414](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@User609571414](https://forums.unrealengine.com/u/User609571414)\
**Post date:** [December 3, 2017, 5:45am UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/8 "2017-12-03T05:45:00Z")

</div>

Hello Iddqd87dm,  
You will not need to link your Player input to the ‘UI’ to receive player input. The Events OnClicked or OnPressed/Released are for handling Mouse and Touch Devices, so they can “click” the button or widget. **If you are using only the keyboard you can run your custom logic from the Player’s ‘Input Actions.’** I can see you already have a custom input mapping, so set up your key input mappings in the Project Settings → Input → Action Mappings.

First: On UI, make a variable of type player, ‘expose it to spawn’ and make it ‘instance editable’.

 ![222347-exposewidgetreference.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/4/2/0421e6ba419dbb5c41b89282c1ffae2b98774101.jpeg)

Then: Create the widget from your Player.

 ![222350-createwidgetui.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/3/4/83401e50f937ebf90ad40ff12f4a85d2cc0229cb.jpeg)

Finally: Run your Logic, and _optionally_ change something on the UI.

Let me know if this was helpful!

 ![222349-keypresstofunction.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/1/1/a11d717edc45b8e3d2f455a55a90409c01bad301.jpeg)

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [December 3, 2017, 1:45pm UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/9 "2017-12-03T13:45:09Z")

</div>

Thanks for help!

---

<div class="post-metadata">

**Author:** ![User609571414](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@User609571414](https://forums.unrealengine.com/u/User609571414)\
**Post date:** [December 3, 2017, 11:51pm UTC](https://forums.unrealengine.com/t/bindings-keyboard-inputs-via-delegates-fail/411144/10 "2017-12-03T23:51:45Z")

</div>

Glad to help. If you feel your question was answered please mark it as resolved to assist other users, thanks!

 ![193592-how_to_img1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/e/f0e5eb7d9be022434e5316a0c94cdb028a184b07.png)
