tags:

views:

2170

answers:

2

If I intercept a key press using win32 calls, I now have a key code. Is there a way to convert that to a System.Windows.Forms.Keys value?

+3  A: 

KeyInterop.KeyFromVirtualKey

xcud
Is there a 2.0 equilavent?
Jeremy
If the int and char keycode are interchangeable then this previous solution should work: <a href="http://stackoverflow.com/questions/544141/how-to-convert-a-character-in-to-equivalent-system-windows-input-key-enum-value/544245#544245">link</a>
xcud
+1  A: 

The integer values for System.Windows.Forms.Keys enum match that of the Win32 calls.

Keys keyData = (Keys)rawWin32KeyCode;
Adam L