如何从虚拟键codeS转换为System.Windows.Forms.Keys [英] How to convert from Virtual Key codes to System.Windows.Forms.Keys
本文介绍了如何从虚拟键codeS转换为System.Windows.Forms.Keys的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我用win32的呼叫拦截关键preSS,我现在有一个关键的code。有没有办法将其转换成一个System.Windows.Forms.Keys值?
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?
推荐答案
有关System.Windows.Forms.Keys的整数值枚举匹配的的Win32调用。
The integer values for System.Windows.Forms.Keys enum match that of the Win32 calls.
Keys keyData = (Keys)rawWin32KeyCode;
这篇关于如何从虚拟键codeS转换为System.Windows.Forms.Keys的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文