【问题标题】:Autohotkey: Remap Win key - when pressed aloneAutohotkey:重新映射 Win 键 - 单独按下时
【发布时间】:2019-04-03 17:06:43
【问题描述】:

由于疯狂的笔记本电脑键盘布局和无法映射 Fn 组合,我想做一些重新映射。我想使用 LWin 键作为修饰符(例如 LWin+Right ==> End 等)。它工作得很好。

但是,我想在单独按下和释放时停止 LWin,以调出 Windows 菜单(b/c 我有时按下修饰符但随后决定不完成操作)我仍然希望能够相当轻松地访问 Windows 菜单,例如通过 LAlt+LWin。 (显然 LWin 必须充当适当的修饰符,否则。)

所以我尝试了:

#LAlt::Send {LWin}

这有点工作但丑陋(需要在按下和释放 Alt 时按住 LWin)。反过来会更自然,即

!LWin::Send {LWin}

但它不起作用(即使带有 $~ 前缀也不行)。

最糟糕的是,我没有成功禁用 LWin 键 单独 以使其仍可用作修饰符:

LWin::Return

彻底杀死它。

我是 autohotkey 的新手(我猜键盘很幸运;));有什么好办法解决这些问题?


更新:到目前为止,这是我的完整热键文件:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#InstallKeybdHook

; Win + arrows
*#Right::Send {End}
*#Left::Send {Home}
*#Down::Send {PgDn}
*#Up::Send {PgUp}

; Sane CapsLock: make it Shift, Shift+CapsLock as CapsLock
CapsLock::Shift
+CapsLock::CapsLock

; Alt-Win to Win (so that Win menu is accessible still)
;   and disable Win alone (so that it won't pop up with navigation)
;??????????????

【问题讨论】:

    标签: windows-10 keyboard-shortcuts autohotkey


    【解决方案1】:

    这应该有效:

    LWin up::return
    <!Lwin::
        send ^{Esc}
    return
    <#right::
        send {end}
    return
    

    在这里使用 Ctrl + Esc 而不是 LWin 可以解决问题。

    【讨论】:

    • 谢谢!我试过了,它确实单独正确处理了 LWin。但是,它似乎已经杀死了我的其他组合(例如 LWin+Right ==> End: *#Right::Send {End})。有机会复活他们吗?
    • 我在我的脚本末尾复制了这 4 行(见上面更新的问题),它似乎不起作用。 LAlt+LWin 确实会调出菜单,但 LWin 也会单独调出菜单,并且 LWin+Arrows 按照 Windows 10 的默认设置工作。
    • @fastcatch 实际上初始代码有效,问题是您需要将&lt;# (Lwin) 与其他热键一起使用才能使其工作。添加示例。
    • 我不确定我是否 100% 理解,但它确实可以这样工作,非常感谢!
    猜你喜欢
    • 1970-01-01
    • 2013-10-19
    • 2021-09-04
    • 1970-01-01
    • 2011-06-14
    • 2011-12-11
    • 1970-01-01
    • 2012-08-09
    • 1970-01-01
    相关资源
    最近更新 更多