I wrote a small program that displays sounds and images on the screen when any button is pressed. I always start when one of my little children crawls to my lap and, of course, accidentally presses the keys.
It works great, except for two keys, one of which is an ON / OFF switch, and the other is a Windows key. (the equivalent of CTRL-ESC, which I suppose), I can intercept it when it is pressed, but only after the start is shown.
The event I'm using is UIElement.KeyDown, and all I could come up with so far is: (e the KeyEventArgs)
if (e.Key == Key.LWin) e.Handled = true;
but the launch window already shows that I'm afraid.
I already have 1 answer, but I would really like to know if there is wpf support?
I suspect that programming the main on / off may not be possible? Otherwise, any help there would also be welcome.
c # wpf keyboard
Peter
source share