Skip to content

Commit

Permalink
fix: alt + key not work
Browse files Browse the repository at this point in the history
  • Loading branch information
amorphobia committed Nov 17, 2023
1 parent b05811f commit d37bd27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- 尚未实现足够多的图形界面,无合适的候选框
- 尚未实现基础设置功能,如重新部署、同步等(在搞定多线程问题之前,重新部署使用 `Reload` 作为临时方案)
- 某些窗口拿不到输入光标所在的坐标,ToolTip 会跟随鼠标光标的位置显示
- 注册热键的问题,例如,上档键输入的字符似乎需要额外注册;热键过多,注册会比较耗时等问题(已取消 Win 键的相关注册,应该有所缓解)
- 注册热键的问题,例如,热键冲突(Alt + 单一按键无法返回给系统继续处理,因此暂时不注册 Alt + 单一按键)等
- 并非使用系统的输入法接口,而是用热键的方式获取按键,可能导致一些问题,如,需要保留一个英文输入语言;退出玉兔毫时,可能无法恢复先前的输入法语言等
- 管理员权限打开的窗口应该不起作用
- Windows 远程桌面连接中,不应拦截切换 ascii mode 的热键,而是交给远程桌面控制
12 changes: 7 additions & 5 deletions Rabbit.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ RegisterHotKeys() {

; Modifiers
for modifier, _ in KeyDef.modifier_code {
if modifier == "LWin" or modifier == "RWin"
continue ; do not register Win keys for now
if modifier == "LWin" or modifier == "RWin" or modifier == "LAlt" or modifier == "RAlt"
continue ; do not register Win / Alt keys for now
local mask := KeyDef.mask[modifier]
Hotkey("$" . modifier, ProcessKey.Bind(modifier, mask))
Hotkey("$" . modifier . " Up", ProcessKey.Bind(modifier, mask | up))
Expand All @@ -103,10 +103,12 @@ RegisterHotKeys() {
Hotkey("$" . key, ProcessKey.Bind(key, 0))
; need specify left/right to prevent fallback to modifier down/up hotkeys
Hotkey("$<^" . key, ProcessKey.Bind(key, ctrl))
if not key = "Tab"
Hotkey("$<!" . key, ProcessKey.Bind(key, alt))
; do not register Alt + single key now
; if not key = "Tab" {
; Hotkey("$<!" . key, ProcessKey.Bind(key, alt))
; Hotkey("$>!" . key, ProcessKey.Bind(key, alt))
; }
Hotkey("$>^" . key, ProcessKey.Bind(key, ctrl))
Hotkey("$>!" . key, ProcessKey.Bind(key, alt))
Hotkey("$^!" . key, ProcessKey.Bind(key, ctrl | alt))
Hotkey("$!#" . key, ProcessKey.Bind(key, alt | win))

Expand Down

0 comments on commit d37bd27

Please sign in to comment.