Changing GamepadAccept to work as Key_Enter instead of Key_Space
Posted: 15 May 2023, 13:37
Hello!
I have a problem with keyboard/gamepad navigation and I'm not sure how to solve it, I think remapping xbox's A button to enter on the keyboard would fix it.
If I have multiple buttons and I hover over one of them with mouse and then change focus with keyboard and press enter, the new keyboard-focused button's command gets invoked (it generally behaves the same as if I clicked it with mouse). However if I press space (or xbox A) in my project the focus jumps to the button that has mouse cursor over it and the command doesn't get invoked on the keyboard-focused button. I have checked with the Buttons sample of Native SDK (controller wasn't working for the Managed SDK sample) and it seems to behave similarly (ie. space/xbox A changes focus, and enter doesn't), but at least the command gets invoked on the correct button.
I don't know why the command is not invoked in our project (both key pressed and released events are raised in correct order), but I was wondering if there is a way to force keyboard space and xbox button A to work the same way as keyboard enter when it comes to navigation and keyboard focus (other than remapping it on our end before passing it onto Noesis). Since that is what I'd expect as the end user (ie. if I start using keyboard/gamepad the mouse should be ignored and the focus jumping to hovered-over contorl is unexpected) and it would also solve the command not being invoked issue.
I have a problem with keyboard/gamepad navigation and I'm not sure how to solve it, I think remapping xbox's A button to enter on the keyboard would fix it.
If I have multiple buttons and I hover over one of them with mouse and then change focus with keyboard and press enter, the new keyboard-focused button's command gets invoked (it generally behaves the same as if I clicked it with mouse). However if I press space (or xbox A) in my project the focus jumps to the button that has mouse cursor over it and the command doesn't get invoked on the keyboard-focused button. I have checked with the Buttons sample of Native SDK (controller wasn't working for the Managed SDK sample) and it seems to behave similarly (ie. space/xbox A changes focus, and enter doesn't), but at least the command gets invoked on the correct button.
I don't know why the command is not invoked in our project (both key pressed and released events are raised in correct order), but I was wondering if there is a way to force keyboard space and xbox button A to work the same way as keyboard enter when it comes to navigation and keyboard focus (other than remapping it on our end before passing it onto Noesis). Since that is what I'd expect as the end user (ie. if I start using keyboard/gamepad the mouse should be ignored and the focus jumping to hovered-over contorl is unexpected) and it would also solve the command not being invoked issue.