gpt4 book ai didi

AutoHotkey 的方向键

转载 作者:行者123 更新时间:2023-12-01 10:40:52 28 4
gpt4 key购买 nike

我要坚持

alt + spacebar + U for the up key
alt + spacebar + H for the left arrow key
alt + spacebar + J for the right arrow key
alt +spacebar + N for the down arrow

这可能与 AutoHotkey 相关吗?

最佳答案

您好,欢迎使用 AutoHotkey,

你可能想看看AHK核心的基本介绍,Hotkeys:

https://www.autohotkey.com/docs/Hotkeys.htm

配置只发送另一个键的热键是相当简单的。例如,alt + spacebar for the up key 可以翻译成

!Space::
send {up}
return

(注意alt是修饰符,可以写成!)或简称:

!Space::send {up}

spacebar + U for the up key 将是 Space & U::send {up}

但您正在寻找 2 个键加上一个修饰符 (alt)。对于由不止两个键 (alt + space + u) 触发的热键标签,您需要一个解决方法:

!Space::    ; once alt + space was pressed, ...
while(getKeyState("alt") || getKeyState("space") || getKeyState("u")) { ; ... while either of these is being pressed down, ...
hotKey, *u, altSpaceU, ON ; u should now send {up}
}
hotKey, *u, altSpaceU, OFF
return

altSpaceU: ; note: this is a label, no hotkey
send {up}
return

请不要被这个吓倒。 AutoHotkey 实际上非常强大且易于学习。遗憾的是,(afaik) 这是解决多于两个键的热键的唯一可行方法。

编辑老天为什么没人告诉我..

#if getkeystate("alt")
!space::send {up}
#if

显然是一种更好的解决方案

关于AutoHotkey 的方向键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30157500/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com