autohotkey 热键
Introduction
介绍
In an
interesting question here at Experts Exchange
, a member requested this:
在
Experts Exchange的
一个
有趣的问题中
,一位成员提出了以下要求:
Code for using Windows AutoHotkey to immediately move mouse pointer to particular monitor
使用Windows AutoHotkey立即将鼠标指针移动到特定监视器的代码
The member has “…several users who have 8 or more monitors connected to their Windows 10 computers.” The requirement is to write an AutoHotkey script that defines a series of keyboard shortcuts (aka “hotkeys”) to move the mouse pointer to each monitor. In particular:
该成员具有“ …将8个或8个以上监视器连接到其Windows 10计算机的几个用户。” 要求是编写一个AutoHotkey脚本,该脚本定义一系列键盘快捷键(也称为“热键”),以将鼠标指针移至每个监视器。 特别是:
Alt+Ctrl+1 ==> move mouse to monitor 1
Alt + Ctrl + 1 ==>将鼠标移至监视器1
Alt+Ctrl+2 ==> move mouse to monitor 2
Alt + Ctrl + 2 ==>将鼠标移至监视器2
Alt+Ctrl+3 ==> move mouse to monitor 3
Alt + Ctrl + 3 ==>将鼠标移至显示器3
Alt+Ctrl+4 ==> move mouse to monitor 4
Alt + Ctrl + 4 ==>将鼠标移至监视器4
Alt+Ctrl+5 ==> move mouse to monitor 5
Alt + Ctrl + 5 ==>将鼠标移至监视器5
Alt+Ctrl+6 ==> move mouse to monitor 6
Alt + Ctrl + 6 ==>将鼠标移至监视器6
Alt+Ctrl+7 ==> move mouse to monitor 7
Alt + Ctrl + 7 ==>将鼠标移动到显示器7
Alt+Ctrl+8 ==> move mouse to monitor 8
Alt + Ctrl + 8 ==>将鼠标移动到显示器8
Alt+Ctrl+9 ==> move mouse to monitor 9
Alt + Ctrl + 9 ==>将鼠标移至监视器9
I wrote a no-frills script (Version 1) and
posted it at the EE thread
. After that, however, I decided to write this EE article with an enhanced script (Version 2).
Version 1 Features
我编写了简洁的脚本(版本1)并将其
发布在EE线程上
。 但是,在那之后,我决定用增强的脚本(第2版)来撰写此EE文章。
版本1功能
The following features are in V1:
V1中具有以下功能:
• Defines the nine hotkeys shown above.
•定义上面显示的九个热键。
• Defines
Alt+Ctrl+0
(zero) as a hotkey to exit the script.
•将
Alt + Ctrl + 0
(零)定义为热键以退出脚本。
• Allows other “modifier” keys to be used for the hotkeys rather than hard-coding
Alt+Ctrl
(”
!^
“), as follows:
•允许将其他“修饰符”键用于热键,而不是硬编码
Alt + Ctrl
(“
!^
”),如下所示:
!
(exclamation mark) ==>
!
(感叹号)==>
Alt
Alt
^
(caret, circumflex, hat) ==>
^
(插入符号,抑扬符,帽子)==>
Ctrl
Ctrl
+
(plus sign) ==>
+
(加号)==>
Shift
Shift
#
(hash mark, pound sign, octothorpe) ==>
#
(井号,井号,八叉戟)==>
Win
(Windows logo key)
Win
(Windows徽标键)
You may use any number of those modifiers, and they may be in any order, that is, ”
!^
” (
Alt+Ctrl
) behaves the same as ”
^!
” (
Ctrl+Alt
).
您可以使用任意数量的这些修饰符,并且它们可以按任何顺序排列,即,“
!^
”(
Alt + Ctrl
)的行为与“
^!
”(
Ctrl + Alt
)相同。
• Allows horizontal (
X
) and vertical (
Y
) offsets to be specified. That is, the mouse pointer will be moved to the specified number of pixels (
OffsetX
) from the l