In order to achieve your requirement you can use the Keyboard.IsKeyPressed()
method. The method excepts a value from the Key enumeration and returns bool value. Here is an example:
sender, RoutedEventArgs e)
// do something
If you want to get the explicit pressed key you can implement a method for this operation.
var allKeys = Enum.GetValues(
Key pressedKey = Key.None;
(currentKey != Key.None && Keyboard.IsKeyDown((Key)currentKey))
I hope this helps.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.