Search found 2 matches
- 22 Dec 2018, 10:48
- Forum: 请求帮助
- Topic: 请问如何检测最后按下的键并执行相应操作? Topic is solved
- Replies: 2
- Views: 8670
Re: 请问如何检测最后按下的键并执行相应操作? Topic is solved
有两个错误。 1. if 语法错误 AHK 中的 if 有两种写法。 第一种就是你代码中那样,这是 AHK 1.0.x 旧版本遗留下来的写法。 if A_priorkey != lbutton or A_priorkey != enter 但是这句代码并不是你以为的那样,它的意思其实是:如果 A_priorkey 不等于 lbutton or A_priorkey != enter 。可运行以下代码验证一下就知道了: s := "lbutton or s = enter" if s = lbutton or s = enter msgbox 是的,s 等于【lbutton or s = en...
- 21 Dec 2018, 09:17
- Forum: 请求帮助
- Topic: 请问如何检测最后按下的键并执行相应操作? Topic is solved
- Replies: 2
- Views: 8670
请问如何检测最后按下的键并执行相应操作? Topic is solved
Code: Select all
#InstallKeybdHook
#InstallmouseHook
sleep 2222
if A_priorkey != lbutton or A_priorkey != enter
exitapp
msgbox you confirmed
鼠标左击或者按回车提示已确认,不过我写的这个代码不管用,永远都是在if里面就退出了,希望高手指点迷津,谢谢!
Moderator Note: Added code tags. ~ sinkfaze