Created
April 21, 2015 05:48
-
-
Save aaronchiang/4aec7a59db9dbffcda51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetKeyDownString(KeyEventArgs args) | |
{ | |
var value = ""; | |
if ((Keyboard.Modifiers & ModifierKeys.Control) > 0) | |
{ | |
value += "Ctrl+"; | |
} | |
if ((Keyboard.Modifiers & ModifierKeys.Alt) > 0) | |
{ | |
value += "Alt+"; | |
} | |
if ((Keyboard.Modifiers & ModifierKeys.Shift) > 0) | |
{ | |
value += "Shift+"; | |
} | |
if ((Keyboard.Modifiers & ModifierKeys.Alt) > 0) | |
{ | |
return value + args.SystemKey; | |
} | |
else | |
{ | |
return value + args.Key; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment