So, I create a widget, override the OnKeyDown function with the blueprint below:
And did this inside the event graph:
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:
Anyone know if/how its possible to make the arrow keys work with onkeydown override function?
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):
Maybe you have a funny keyboard
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?
Thanks for the reply
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??
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
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
But the numpad 5 (numlock off) still
returning “None”, but maybe its
because 5 without numlock is just…
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
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
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?
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
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!
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