0

如何使用以下代码更简洁地为特定程序定义多个快捷方式?

#IfWinActive ahk_class AcrobatSDIWindow
0::Send !vp  ^0 
#IfWinActive ahk_class AcrobatSDIWindow
1::Send ^1 
#IfWinActive ahk_class AcrobatSDIWindow
2::Send !vpc ^2 

如何定义一些类似程序(例如PDF阅读器软件)之间的通用快捷方式

4

2 回答 2

2

@雷扎,

要组合多个应用程序,请使用 GroupAdd。将 GroupAdd 与 SetTitleMatchMode 放在顶部,在任何 Return 命令之前。

GroupAdd, IfWinGroup , Acrobat
GroupAdd, IfWinGroup , Evernote ; Not that the following shortcuts make any sense in Evernote, but it shows how to create groups of shortcuts that are used in more that one application.
SetTitleMatchMode, 2

#ifWinActive, ahk_group IfWinGroup
    0::Send !vp  ^0
    1::Send ^1
    2::Send !vpc ^2
#ifWinActive
于 2012-10-05T08:56:10.750 回答
1

@雷扎,

这是你想要的?这将为 Evernote 和 Chrome 设置快捷方式。

SetTitleMatchMode, 2

#ifWinActive, Evernote
+Numpaddiv::Send, / ; Shift NumPadDiv is now the standard /
+NumpadMult::Send, *
+Numpadsub::Send, -
+NumpadAdd::Send, +=
^Numpaddiv::Send, (
^NumpadMult::Send, )
Numpaddiv::Send, {Space}/{Space} ; NumPadDiv will send space/space
NumpadMult::Send, {Space}*{Space}
Numpadsub::Send, {Space}-{Space}
NumpadAdd::Send, {Space}+={Space}
NumPadDot::Send, `,
#ifWinActive

#ifWinActive, Chrome
NumpadIns::Send, {Click}
+NumpadPgdn::Send, {PgUp} ; Shift + PageDown = PageUp
+NumpadDown::Send, {Up} ; Shift + Down = Up
NumpadRight::Send, ^{PgDn} ; Right arrow = activate next Tab
NumpadLeft::Send, ^{PgUp} ; Left arrow = activate previous tab
+NumpadClear:: ; NumPad 5 = Park mouse right hand top of screen
NumpadClear::MouseMove,(1340),(100) ; NumPad 5 = Park mouse right hand top of screen
+NumPadSub::Send, ^{F4} ; NumPad Minus = Close tab
NumPadDel::Send, . ; NumPad Del = dot to delete mail in gmail
SC16D::Send, +j ; Jump ONE G+ Story down with Music Media Button
+SC16D::Send, +k ; Jump ONE G+ Story up with Play/Pause button
#ifWinActive
于 2012-10-05T07:52:22.870 回答