GetAysncKeyState 小写
我已经声明了该函数
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Integer
,但诸如此类的代码
If GetAsyncKeyState(100) then
'do something
End
将不起作用[它曾经是-.-]。但是用“Keys.D”替换 100 就可以了。这就留下了仅限于大写字母的问题。
有没有办法让 Keys.a (小写)或在 GetAsyncKeyState 中使用 ascii 代码?
提前致谢。
I have declared the function
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Integer
But a code such as
If GetAsyncKeyState(100) then
'do something
End
Will not work [It used to -.-]. However replacing 100 with 'Keys.D' will. Which leaves the problem of being limited to capital letters.
Is there a way to have Keys.a (as lowercase) or a way to use ascii codes in GetAsyncKeyState?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
100
(十进制)是VK_NUMPAD4 (0x64)
?如果您想检测小写字母,则需要检查
VK_CAPITAL
& 的状态。VK_SHIFT
。100
(decimal) isVK_NUMPAD4 (0x64)
?If you want to detect lowercase you would need to examine the state of
VK_CAPITAL
&VK_SHIFT
.