使用 Autohotkey 映射專為 Excel 設計的 Page Up、Page Down 和 Num Lock

使用 Autohotkey 映射專為 Excel 設計的 Page Up、Page Down 和 Num Lock

我想將這些鍵映射到相應的文本:

向上翻頁(

下翻頁 )

數字鎖定=

我想用 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

相關內容