# On Key Down Not Triggering

**URL:** <https://forums.unrealengine.com/t/on-key-down-not-triggering/482946>\
**Category:** UI\
**Tags:** unreal-engine, functions, Widget, Blueprint, question\
**Created:** [May 5, 2021, 5:06pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946 "2021-05-05T17:06:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zego\_Fr34ks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zego\_Fr34ks](https://forums.unrealengine.com/u/Zego_Fr34ks)\
**Post date:** [May 5, 2021, 5:06pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/1 "2021-05-05T17:06:11Z")

</div>

Hi, I want to print my pressed key on the screen so I used this to do it:

 ![338061-ue4key.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/a/46af8051793211fb760db36597a49c8e6f4aefd5.png)

But it doesn’t get triggered (my widget is added to the viewport).  
Does anybody know what I did wrong?

---

<div class="post-metadata">

**Author:** ![ugmoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ugmoe](https://forums.unrealengine.com/u/ugmoe)\
**Post date:** [May 5, 2021, 5:20pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/2 "2021-05-05T17:20:59Z")

</div>

Put a break point on your print string node. On windows, you can press F9

Now test your widget, and when you press a button, the game should pause and the editor should focus on your break point.

If nothing happens, then there is something wrong with the design part of your widget and we will need more info to help

---

<div class="post-metadata">

**Author:** ![Zego\_Fr34ks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zego\_Fr34ks](https://forums.unrealengine.com/u/Zego_Fr34ks)\
**Post date:** [May 5, 2021, 5:41pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/3 "2021-05-05T17:41:05Z")

</div>

It didn’t do anything.  
I followed this tutorial: [How to Create A Terminal System in UE4](https://80.lv/articles/how-to-create-a-terminal-system-in-ue4/)  
and this is my world blueprint:

 ![338062-ue4key2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/4/794b56cc1e885c2482c88af86bcb9c2fc59f643b.png)

And it’s based on the ThirdPersonBP.

---

<div class="post-metadata">

**Author:** ![ugmoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ugmoe](https://forums.unrealengine.com/u/ugmoe)\
**Post date:** [May 5, 2021, 5:47pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/4 "2021-05-05T17:47:12Z")

</div>

well at some point you have to use SetInputModeUI if you want OnKeyDown to trigger.

If you don’t use this function, the game consumes all of your inputs

---

<div class="post-metadata">

**Author:** ![w2lf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@w2lf](https://forums.unrealengine.com/u/w2lf)\
**Post date:** [May 5, 2021, 6:06pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/5 "2021-05-05T18:06:14Z")

</div>

In the widget enable Is Focusable then make sure visibility is set to visible. Then on begin play Set Focus function. Now your key down should trigger, but if you click any mouse key it will remove focus and you won’t get any key triggers. (You could have some code that runs Set Focus when you need to type.)

Or instead of Set Focus you could just override mouse down and that should automatically make the widget focused when you press any mouse key then you will be able to type any key and get key down trigger.

---

<div class="post-metadata">

**Author:** ![Zego\_Fr34ks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zego\_Fr34ks](https://forums.unrealengine.com/u/Zego_Fr34ks)\
**Post date:** [May 5, 2021, 6:17pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/6 "2021-05-05T18:17:42Z")

</div>

It’s what I did here:

 ![338063-ue4key3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/8/1b8d90f3f3a27cdd25f7901fd2b74ccc226ecedd.png)

---

<div class="post-metadata">

**Author:** ![Zego\_Fr34ks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zego\_Fr34ks](https://forums.unrealengine.com/u/Zego_Fr34ks)\
**Post date:** [May 5, 2021, 7:41pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/7 "2021-05-05T19:41:48Z")

</div>

How can I set Focus?

---

<div class="post-metadata">

**Author:** ![Zego\_Fr34ks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zego\_Fr34ks](https://forums.unrealengine.com/u/Zego_Fr34ks)\
**Post date:** [May 5, 2021, 7:44pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/8 "2021-05-05T19:44:49Z")

</div>

nvm I found it, thank you

---

<div class="post-metadata">

**Author:** ![holmesjtg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@holmesjtg](https://forums.unrealengine.com/u/holmesjtg)\
**Post date:** [September 9, 2022, 10:21pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/9 "2022-09-09T22:21:49Z")

</div>

Would you mind posting a screenshot of the whole process? Having the same issue and got kind of lost following this thread. Thanks!

---

<div class="post-metadata">

**Author:** ![lwjacob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lwjacob/32/615841_2.png) [@lwjacob](https://forums.unrealengine.com/u/lwjacob)\
**Post date:** [January 14, 2023, 2:48am UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/10 "2023-01-14T02:48:22Z")

</div>

Almost 1 hour trying and searching. What finally worked is the node Set Visibility.  
I forgot that I changed it in the Designer mode. Something so simple can take so much time.

---

<div class="post-metadata">

**Author:** ![dudusstar](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dudusstar/32/753224_2.png) [@dudusstar](https://forums.unrealengine.com/u/dudusstar)\
**Post date:** [February 18, 2024, 6:21pm UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/11 "2024-02-18T18:21:04Z")

</div>

So what was the issue then and how did you solve it? Thanks

---

<div class="post-metadata">

**Author:** ![LesPaul0689](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LesPaul0689](https://forums.unrealengine.com/u/LesPaul0689)\
**Post date:** [April 12, 2024, 8:09am UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/12 "2024-04-12T08:09:42Z")

</div>

Thanks anonymous\_user\_dfedb823 !! I follow a tutorial on Youtube and the person talk about the “Focusable”, but not the set Visibility.  
I select the root of the widget, type visibility in the search bar and set the it to “Visible” and it work now 👍

---

<div class="post-metadata">

**Author:** ![misterfischer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@misterfischer](https://forums.unrealengine.com/u/misterfischer)\
**Post date:** [July 24, 2024, 11:03am UTC](https://forums.unrealengine.com/t/on-key-down-not-triggering/482946/13 "2024-07-24T11:03:17Z")

</div>

Setting it to focusable was the missing piece for me. Needed to hit Class Defaults \> Interaction \> IsFocused
