Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

UMG - navigation keys + onkeydown don't work

So, I create a widget, override the OnKeyDown function with the blueprint below:

alt text

And did this inside the event graph: alt text

Its working, except the "navigation" keys: arrow keys (left, right) and for the numpad directional (when you turn off NumLock) numbers 8,4,6 and 2 don't work. In the example above, when I press D, print string shows True, when I press arrow key Right, nothing happen, I don't get True or False, but if I press any other key (except the keys I comment before), I get False.

Also, this is what I have on my level bp: alt text

Anyone know if/how its possible to make the arrow keys work with onkeydown override function?

Product Version: UE 4.20
more ▼

asked Aug 10 '18 at 02:28 PM in Blueprint Scripting

avatar image

75 7 15 19

avatar image AlvHid Sep 20 '18 at 05:01 PM

Rgiz I am having the same problem... I checked the video and I made the class focusable, but still not able to recognize the navigation keys.

But when I open the project of Kitatus, it works perfectly, so I am definitely missing something :(

Best regards

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I just tested this and, on my end, it seems to work like you'd expect.

Consider doing this to see what you're actually pressing when you hit numpad keys you mentioned (with no lock):

alt text

Maybe you have a funny keyboard :)

capture.png (81.1 kB)
more ▼

answered Aug 10 '18 at 03:22 PM

avatar image

14.7k 76 25 61

avatar image Rgiz Aug 10 '18 at 03:52 PM

Thanks for the reply :D So, I think I have a funny keyboard :(, cause I did what you say, and the print don't show nothing when I press arrow keys or numpad without lock or space bar :/

When you press arrow keys (left or right) the print string print something??

alt text

umg-onkeydown1.png (81.2 kB)
avatar image Everynone Aug 10 '18 at 03:54 PM

Yup, with NumLock On, it prints Num 2, Num 6... With NumLock Off, it prints Left, Right...

Interestingly enough, numpad 5 (with numlock off) prints literally "None" :)

Are you on a laptop?

avatar image Rgiz Aug 10 '18 at 04:17 PM

Same here for the numpad (with numlock off) I got a "None"

I´m using a desktop with a normal usb keyboard (from SteelSeries), no keyboard app, nothing. But my widget is a custom widget, but I don't think this will "break" the OnKeyDown override

avatar image Rgiz Aug 10 '18 at 04:28 PM

So OnKeyDown or Up doesn't work inside a custom widget (User Created), like, only works on the "top" widget, eg: you put your user created widget inside another widget (Main Menu widget) inside the Main Menu widget you can use the OnKeyDown / Up override function without problem...

But the numpad 5 (numlock off) still returning "None", but maybe its because 5 without numlock is just.. none xD

avatar image Everynone Aug 10 '18 at 05:12 PM

But the numpad 5 (numlock off) still returning "None", but maybe its because 5 without numlock is just.. none xD

Yup, that's what I learnt today!

So OnKeyDown or Up doesn't work inside a custom widget (User Created)

You may need to explicitly give it KeyboardFocus (there's a node for this). Instead of (or in addition to) Setting Input Mode in your pic3, get your CustomWidget from the Main menu and make it the target of Keyboard Focus - also make sure that the custom widget has the Focusable tickbox checked

avatar image Rgiz Aug 10 '18 at 09:24 PM

What Im trying to do is a text switch button, instead of using the combo box to add resolution, shadow quality, etc, I want to do something like in the image below, from Vanish of Ethan Carter, Fortnite have this as well but its not added in the engine.. yet.

The problem is make the UMG "talk" with keyboard/gamepad using blueprints and the lack of UMG docs :/

alt text

avatar image Everynone Aug 11 '18 at 08:21 AM

You should be able to achieve this by giving the desired widget keyboard focus. Is it not working?

Is each line in your setup a custom widget?

avatar image Rgiz Aug 12 '18 at 07:20 PM

So yesterday I found this video, from KITATUS on the YT and I just ask him, how he implement the keyboard support and on the comments he shared a link to one of his project, just check out, its a nice start :) ALso if I manage to make my version I will post here, cause nobody deserve the keyboard/umg frustration :D

avatar image Everynone Aug 12 '18 at 09:58 PM

Wasn't the original problem that your numpad keys acted funny... ?

Not sure if I follow as keyboard navigation has always worked fine for me.

Anyhow, good luck with the rest!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question