Advertisement
Guest User

Untitled

a guest
May 29th, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public static string GetKeyDownString(KeyEventArgs args)
  2. {
  3. var value = "";
  4.  
  5. if ((Keyboard.Modifiers & ModifierKeys.Control) > 0)
  6. {
  7. value += "Ctrl+";
  8. }
  9.  
  10. if ((Keyboard.Modifiers & ModifierKeys.Alt) > 0)
  11. {
  12. value += "Alt+";
  13. }
  14.  
  15. if ((Keyboard.Modifiers & ModifierKeys.Shift) > 0)
  16. {
  17. value += "Shift+";
  18. }
  19.  
  20. if ((Keyboard.Modifiers & ModifierKeys.Alt) > 0)
  21. {
  22. return value + args.SystemKey;
  23. }
  24. else
  25. {
  26. return value + args.Key;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement