问题
I've got a global command like this
!i::Send {Up}
(pressing alt+I
will move the caret up)
There is an application that uses Alt+I
as a shortcut for an action that I'd like to call while still retaining my own custom shortcut. I'd like to remap this app's action to Ctrl+I
Within a proper WinExists, I've tried ^i::Send !{i}
but that just moves the caret up.
I tried ^i::!i
but that sends Ctrl+Alt+I
and not Alt+I
.
Any ideas? Thanks
回答1:
Gabe,
Try this...
SetTitleMatchMode, 2 ; Accept the title search string to be found anywhere in title
#ifWinnotActive yourappname ; use windowspy to find a unique title string
!i::Send {Up}
#ifWinActive
This will set !i to behave just like you want in ALL programs except for the one you want to keep the special behaviour.
Alternatively, you could add a $ to the triggers, so they will not call each other like this:
$!i::Send, {Up}
$^i::Send, !i
回答2:
After each command, you need to add the command return. So if you have the code:
!i::Send, ^i
return
^i::Send, !i
return
The code above inverts the functions of CTRL + i and ALT + i.
来源:https://stackoverflow.com/questions/11231031/sending-a-command-when-the-shortcut-exists