UMG keyboard events

I have FInputModeUIOnly turned on, but I need to get keyboard events to a menu (namely I would like to be able to have the escape key cancel menus). Is there a way to do this?

I too would like to know. I have working menus that are currently mouse driven. It would be nice to have keyboard support also. I would like to get the arrow keys to move a menu pointer and number keys to pick the exact menu option.

is FInputModeUIOnly just C++ ? never seen or used it before in BPs

in BPs I usually just use Set Input Mode Game and UI node to the widget but I don’t use the mouse other than to click a button etc.

dunno if this’ll help but: you can set input events in the Project Settings under the Settings Tab at top of viewport then you can access those events pretty much anywhere, altho I put them in the Character BP or I suppose map level BP would work too

also you can just right click in a BP and hit the key you want to use to access an event associated with it

you can do this even if you are coding in C++ altho if you are you should ask this question in that Forum Topic not BP Scripting Topic

hope that helps a bit, good luck :wink:

From what I’ve seen you can’t use any of the normal action or axis bindings nor can you use generic keypress events. Unless I’m missing something.

think I understand, I know I’ve seen problems like this before not sure how they were solved because haven’t ran across it myself yet.

but you might have to change from the FInputModeUIOnly to some other mode
found this -> “You can also specify through the IsFocusable option if a button should only be mouse-clickable and never keyboard focusable”

so there must be some way to use keyboard, i’d think so anyway

I could do it through the character BP, but I don’t want to. I would prefer to handle the input from the UMG BP itself.