【发布时间】:2018-09-04 20:42:28
【问题描述】:
各位,
我想使用 AutoHotkey 创建一个基于图层的键盘。基本上,我想实现 shift 已经做的事情:在使用修饰符时修改每个键。
我想在以下方面改进常规班次:
- 按下修饰符一次:只为下一个字符改变图层
- 按住修饰符:只要修饰符关闭就改变图层
- 按两次修饰符:进入图层模式,如大写锁定。 (以另一种方式结束)
修饰符:LAlt、RAlt、LControl、RControl(CapsLock、Shift)
我如何做到这一点?
到目前为止我在 stackoverflow 上发现的内容: 此代码允许为下一个字符按下和释放 shift
$*LShift::
SendInput, {LShift Down} ; press shift
Input, Key, L1 M V ; wait for input character
If GetKeyState("LShift", "P") ; if shift still pressed, wait for release
KeyWait, LShift
SendInput, {LShift Up} ; send input with shift down, the shift up
Return
此代码将双班按转换为 CapsLock
LShift::
KeyWait, CapsLock ; wait to be released
KeyWait, CapsLock, D T0.2 ; and pressed again within 0.2 seconds
if ErrorLevel
return
else if (A_PriorKey = "CapsLock")
SetCapsLockState, % GetKeyState("CapsLock","T") ? "Off" : "On"
return
#If, GetKeyState("CapsLock", "P") ; hotkeys go below
a::b
#If
但我对 AHK 的经验不足,无法将其整合在一起。我的目标是拥有类似的东西
Modifier::
; code that makes the modifier behave like expected: single press, hold, double press
Return
#If, GetKeyState("Modifier", "P") ; List of key remaps in specific layer
#If
我希望这足够具体,并且您可以在这里帮助我。
谢谢!
【问题讨论】:
标签: autohotkey