Autohotkey Photoshop在AHK之前接收输入
几年前,我写了以下脚本:Autohotkey Photoshop在AHK之前接收输入,autohotkey,Autohotkey,几年前,我写了以下脚本: #IfWinActive ahk_class Photoshop #Wheelup:: Send, {vkDD} return #IfWinActive ahk_class Photoshop #WheelDown:: Send, {vkDB} return 当我在按下win键的同时向上或向下旋转鼠标时,此脚本生成输入“[”或“]”。这个脚本工作得很好,但现在,当我安装photoshop 2020时,它不工作了。我以为阿库的课程已经改了,但事实并非如此。当我删除ifW
#IfWinActive ahk_class Photoshop
#Wheelup::
Send, {vkDD}
return
#IfWinActive ahk_class Photoshop
#WheelDown::
Send, {vkDB}
return
当我在按下win键的同时向上或向下旋转鼠标时,此脚本生成输入“[”或“]”。这个脚本工作得很好,但现在,当我安装photoshop 2020时,它不工作了。我以为阿库的课程已经改了,但事实并非如此。当我删除ifWinActive行时,脚本将字符发送到记事本,但没有发送到photoshop。另外,当Photoshop也处于活动状态时,我的其他Binging也不起作用。
我应该怎么做才能解决这个问题?如果Photoshop是以管理员权限运行的,那么AHK将不会拦截按键,这很可能就是这个问题背后的原因 如果是这种情况,请尝试以管理员身份运行AHK脚本,方法是将以下内容添加到脚本顶部:
; If the script is not elevated, relaunch as administrator and kill current instance:
full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
try ; leads to having the script re-launching itself as administrator
{
if A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
有关更多详细信息,请阅读。如果Photoshop是以管理员权限运行的,那么AHK将不会拦截按键操作,这很可能是此问题背后的原因 如果是这种情况,请尝试以管理员身份运行AHK脚本,方法是将以下内容添加到脚本顶部:
; If the script is not elevated, relaunch as administrator and kill current instance:
full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
try ; leads to having the script re-launching itself as administrator
{
if A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
有关更多详细信息,请阅读。谢谢,就是这样!谢谢,就是这样!