I’m using the cursor keys to move my character around (just like WASD does).
If I have a button in my HUD and click on this Button, cursor keys seem to be hard coded to navigate into the UI. So pressing e.g ‘Left’ in this situation does not move my character anymore. To be able to move again, I’ve to click into the game window again.
I already tried to disable focus on buttons and tried all values in the ‘Navigation’ tab of the button (in Designer) for Left/Right/Up/Down/Next/Previous.
Is it possible to get around that hard coded functionality?
Thank you.
2.) Besides WASD, set the cursor keys as motion input for your character in the project settings
3.) Subclass C++ class ‘MyUserWidget’ from UUserWidget
4.) Subclass blueprint ‘BP_MyUserWidget’ from ‘MyUserWidget’
5.) add 2 Buttons to ‘BP_MyUserWidget’ in the designer tab
6.) compile and start play
7.) click on one of the buttons
8.) notice that you cannot walk anymore using the cursor keys, but WASD still works. This is the bug. It should still be possible to use the cursor keys to move the character.
After reading over your steps provided this appears to be working as intended. The button is supposed to capture the mouse input. If you would like to make it so that you mouse does not interact with a widget you could use the visibility setting “Self Hit invisible” I hope that this information helps.
Thanks for the clarification, I was able to reproduce this issue on our end. I have written up a report (UE-21174) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your information and time.
Working as intended. If you don’t want the UI to consume navigation keys, don’t place focus on the UI. Buttons by default are focusable, and will take focus when clicked. So change the button to not be focusable. The arrow keys are navigation keys that shift focus between UI elements, so that keyboard and controller input can be used to navigate the UI.
I have absolutly same issue. In my RTS game, when I click on HUD button I can not pan map anymore using arrows. I tested all Input Modes and also my buttons are not Focusable… it is really annoying for players and there needs to be someway how to disable this functionality.
SetFocusToGameViewport will put focus back on the viewport widget. If it’s not the buttons, you probably have another widget higher up that’s becoming focused, user widgets can also be made focusable. You could enable always showing the focus rectangle in your user interface project settings to see which widget has the focus. I believe the widget reflector also has this capability.
Thanks for helping, Nick.
Your idea with the focus rectangle helped me to experiment.
I now think the problem is the viewport widget. If it has focus, player navigation with cursor keys does not work. If no widget (including the viewport widget) has focus, cursor keys work as expected.
If viewport widget has focus, clicking once into the game window has the desired effect of ‘unfocussing’ all widgets (including viewport widget).
Yes I have a problem with this when trying to rebind actions to the arrow keys. I have click on screen where there’s no buttons first then is will take an arrow key but because the mouse button is binded to shoot I’ll get a conflict error before I can rebind to the arrow key.
I have provided a link to the public tracker. If you visit the link you will see that this issue was closed as “By Design”. I hope that this information helps.
all I get from that is, I having this problem in 4.11.2, so from 4.9.1 to 4.11.2 no solution for this problem has been found. I just started working on a new project and one of the first things they want me to do is fix the projects key binding, and I’ll be having the same problem. I’m gonna try using a popup widget with no buttons to see if that works.
I have provided a link to documentation that goes over the nodes used to set input. The nodes such as “Set input game only” will help you manage your inputs. I hope that this information helps.