这应该很容易做到,但我搞不懂。要在新选项卡中打开链接并在 Chrome 中切换到它,请按 ctrl+shift 并单击。我希望鼠标上的按钮映射到 ctrl+shift。我尝试了以下方法,但都不起作用:
XButton1::+^
XButton1::+ctrl
XButton1::^shift
XButton1::SendInput, {shift}{ctrl}
XButton1::Send, {shift}{ctrl}
我该怎么做呢?
答案1
尝试这个:
XButton1:: Send {XButton1} ; If you remove this line, XButton1 loses its native function
XButton1 & LButton:: ; XButton1 becomes a prefix key
If WinActive("ahk_exe chrome.exe") ; open a link in a new tab:
Send, {Shift Down}{Ctrl Down}{LButton Down}{LButton Up}{Ctrl Up}{Shift Up}
; If WinActive("ahk_exe notepad.exe")
; do sth
; If WinActive...
; do sth else
return