Skip to content

Instantly share code, notes, and snippets.

@knwng
Last active October 23, 2025 05:00
Show Gist options
  • Select an option

  • Save knwng/b98b72232e98950eb0f9ef293b4ca55f to your computer and use it in GitHub Desktop.

Select an option

Save knwng/b98b72232e98950eb0f9ef293b4ca55f to your computer and use it in GitHub Desktop.
HHKB keyboard mapping using AutoHotKey
#Requires AutoHotkey v2.0
#UseHook ; 让热键统一走低级键盘钩子,减少 up 丢失
; ---------------------------
; 1) Tab 切换
; Ctrl + Alt + ←/→ => Ctrl + PgUp/PgDn
; ---------------------------
^!Right::Send '{Blind}^{PgDn}'
^!Left::Send '{Blind}^{PgUp}'
; ---------------------------
; 2) 单词跳转
; Alt + ←/→ => Ctrl + ←/→
; ---------------------------
!Left::Send '{Blind}^{Left}'
!Right::Send '{Blind}^{Right}'
; ---------------------------
; 3) 删除一个单词
; Alt + Backspace => Ctrl + Backspace
; ---------------------------
!Backspace::Send '{Blind}^{Backspace}'
; ---------------------------
; 4) 虚拟桌面切换
; Ctrl + ←/→ => Win + Ctrl + ←/→
; ---------------------------
^Left::Send '{Blind}#^{Left}'
^Right::Send '{Blind}#^{Right}'
; ---------------------------
; 5) LWin => LCtrl(显式 down/up,避免卡住)
; 使用 * 通配,确保带其它修饰键时也能捕获到
; ---------------------------
*LWin::
{
Send '{LCtrl down}'
}
*LWin up::
{
Send '{LCtrl up}'
}
; ---------------------------
; 6) RAlt => LWin(同样显式 down/up)
; ---------------------------
*RAlt::
{
Send '{LWin down}'
}
*RAlt up::
{
Send '{LWin up}'
}
; (可选)如果你不希望物理 LWin 触发系统开始菜单,可额外屏蔽原生 Win:
; ~LWin::Return ; 但上面已把 LWin 转成 Ctrl,一般不需要这行
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment