-
-
Save wongsyrone/424dd6b12da3e8276cae39c515af6856 to your computer and use it in GitHub Desktop.
Convert between System.Windows.Forms.Keys and System.Windows.Input.Key
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
Keys formsKey = Keys.A; | |
Key wpfKey = Key.A; | |
wpfKey = KeyInterop.KeyFromVirtualKey((int)formsKey); | |
formsKey = (Keys)KeyInterop.VirtualKeyFromKey(wpfKey); | |
// The KeyInterop class is the "key," plus the fact that the Windows Forms Keys enumeration has the same integer values as the Win 32 virtual key codes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment