Background: I have an application where I want to be able to capture keyboard events. On the main screen, the user clicks a Start button. During the game, the Start button goes away and a Reset button is shown (Visibility changes on the two controls). These are the only two standard controls involve as all else is non-focusable user controls.
Problem: When the user clicks Start (thereby giving it focus), then it hides and Reset appears, the Reset button automatically seems to get the focus. This isn't awful since key press events are still raised, but the focus causes a big problem. If the user presses Space, then the button interprets it as a Click event.
If I add a handler for KeyUp and KeyDown to the button itself and set the event to Handled, it will swallow the event if I hold down the space and let go, but not if I just tap it.
Question: How can I prevent Space from activating a button, while still being able to respond to the Space in my app?