使用 Autohotkey 将 Page Up、Page Down 和 Num Lock 映射到 Excel

使用 Autohotkey 将 Page Up、Page Down 和 Num Lock 映射到 Excel

我想将这些键映射到相应的文本:

向上翻页 (

向下翻页 )

数字锁定 =

我想用 Autohotkey 来做这件事,但我很难弄清楚脚本。我也只想在 excel 中做到这一点。

我知道我需要添加#IfWinActive ahk_class XLMAIN

答案1

您可以使用 SetTitleMatchMode, 2 并使用窗口标题的一部分,如:Excel,或者使用#IfWinActive ahk_class XLMAIN 的解决方案。

#IfWinActive ahk_class XLMAIN ; Start the Excel specific section
PgUp::Send, {(}
PgDn::Send, {)}
NumLock::Send, {=}
#IfWinActive , ; Close the Excel specific section

相关内容