WPF - How to capture when pressing CTRL + SHIFT?

When the user presses the left CTRL + left SHIFT, I want to make the whole application translucent (for example, the VS2008 intellisense popup). If I write my code in the KeyUp event, I can capture both keys pressed, but the transparency effect should be active only when the keys are pressed. When they are released, the opacity should return to 100%. The behavior I want is actually a KeyDown event, but I cannot capture both keys in KeyDown, can I?

thanks

+4
source share
1 answer

Use the static methods of the Keyboard class, in particular IsKeyDown() , to check the status of the keys you are interested in.

In KeyDown you can use this to enable transparency, and on KeyUp you can turn off the effect again. If you are on it, you can save the state of the key yourself and act on it.

+17
source

All Articles