button keyboard opening
I'm having a bizarre bug with buttons, when I keep pressing several keys "space" numbers I end up pressing the button as if I had pressed "enter" but I'm already using this function in each button: KeyboardNavigation.AcceptsReturn="False", is there any other function to be used that avoids this kind of problem?
i am using neosis 3.1.5 c++
i am using neosis 3.1.5 c++
-
sfernandez
Site Admin
- Posts: 2983
- Joined:
Re: button keyboard opening
Hello,
The space bar is the default action key used to press a focused Button.
The return key can also be used to press a focused Button if you set KeyboardNavigation::AcceptsReturn to true. But setting it to false, only disables the return key, not the space key.
If you want to disable the space bar default behavior you have to handle the PreviewKeyDown for the button and mark it as handled for the space bar key. This can be done using a custom behavior assigned to your button (with a style if you want to reuse it).
The space bar is the default action key used to press a focused Button.
The return key can also be used to press a focused Button if you set KeyboardNavigation::AcceptsReturn to true. But setting it to false, only disables the return key, not the space key.
If you want to disable the space bar default behavior you have to handle the PreviewKeyDown for the button and mark it as handled for the space bar key. This can be done using a custom behavior assigned to your button (with a style if you want to reuse it).
Re: button keyboard opening
ok thanks for the reply, maybe a suggestion for the future to also have the option to deactivate the same space you can do with return, thanks for your attention!
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 97 guests