VB中怎么获取键`,键~,键<,键>,键,,键.,键?,键/,键+,键=,键-,键_ 都是主键盘上的键
展开全部
用GetAsynckeystate来判断其状态的话 估计你键值写错了吧
X = GetAsyncKeyState(186)
If X = -32767 Then
Text1.Text = Text1.Text + ";"End IfX = GetAsyncKeyState(187)
If X = -32767 Then
Text1.Text = Text1.Text + "="End IfX = GetAsyncKeyState(188)
If X = -32767 Then
Text1.Text = Text1.Text + ","
End IfX = GetAsyncKeyState(189)
If X = -32767 Then
Text1.Text = Text1.Text + "-"End IfX = GetAsyncKeyState(190)
If X = -32767 Then
Text1.Text = Text1.Text + "."
End IfX = GetAsyncKeyState(191)
Text1.Text = Text1.Text + "/"End If以上都是测试过的,没问题,至于< ? ~之类的要按shift才能打出来的符号没有键值,可以查看对方按了shift+其他标点来确定
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询