I have a project where I’m using arrow keys to rotate a model. I have some buttons on the screen that toggle some things which the user can click at any time since the mouse is always free to move around. When I click a button, then try to press my keyboard keys to rotate the model, the key release events don’t fire, causing my model to start spinning freely. Here’s what my GUI looks like:
So first off I realized it was not generating pressed events, rather than released events.
Yes
Make more than one button in a widget blueprint, put arrow key based key events on something else in the scene, press one of your gui buttons, and then using the arrow keys won’t generate “pressed” events for your object in the scene.
So upon closer examination I realized what is going on. When I press a button on the UI, it goes into a selection mode which makes pressing the arrow keys highlight buttons rather than execute “pressed” events in game (you can see a white border around one of the buttons in the screenshot). I assume this is intended behavior in screens where everything is a button like on a pause menu, but for my application I need the user to be able to interact with the scene and use the buttons in a way that’s responsive. Is there some way to disable this behavior on the buttons?
Disabling that option only makes it so the buttons are no longer highlighted, which only means that I can no longer navigate between them with the arrow keys and press enter to activate them. Even when I have the option disabled on all of my buttons, the buttons still gobble up the key press events from my arrow keys.
I have not tried, I’ve never used the overrides before. I can do some research into how they work if that’s the only way to fix this, but doesn’t it seem like unintended functionality if I deselect “Is Focusable” and the button still reroutes focus from the main game window?
The reason I made the suggestion above is because I believe that the widget is taking the input focus. By using the widgets on key down override this will allow you to use your inputs even when the widget has focus. You could also play around with setting the input modes to try and achieve your desired result.