小白求教,autohotkey脚本运行不正常

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

zhizunbao84
Posts: 1
Joined: 15 Oct 2019, 05:18

小白求教,autohotkey脚本运行不正常

15 Oct 2019, 05:27

请教各位高手,我的电脑是win7 64位,使用autohotkey 1.1.31.01

测试代码:

Code: Select all

:*:ad::
MsgBox, mypath

定义了个热字符串,弹出个对话框,上面显示mypath

但是运行很诡异,除了弹出mypath,还会导致我的目录跳来跳去
Attachments
33333333333.gif
33333333333.gif (1.67 MiB) Viewed 6157 times
Last edited by tmplinshi on 15 Oct 2019, 07:17, edited 1 time in total.
Reason: 添加代码标签
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: 小白求教,autohotkey脚本运行不正常

15 Oct 2019, 07:16

因为默认情况下热字符串会删除热字符串自身,当发送 Backspace 键删除字符时又触发了资源管理器的后退功能,所以就出现了你说的这种情况。

可以使用 b0 关闭发送后退键。

Code: Select all

:*b0:ad::
	MsgBox, mypath
return
也可以单行:

Code: Select all

:X*b0:ad::MsgBox, mypath
User avatar
telanx
Posts: 68
Joined: 10 Jan 2020, 14:31

Re: 小白求教,autohotkey脚本运行不正常

11 Jan 2020, 00:31

@tmplinshi
還有這種說法,學習到了,確實如果不在輸入框的情況下輸入會出現發送回退給窗口然後導致窗口行為的情況,加了B0以後就不會了.如果在輸入框輸入的話就沒有這樣的問題.

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 46 guests