仅重新映射 Windows 键,保留 windows 键组合

Remap only Windows key, keeping windows key combinations

我希望仅在单独按下时重新映射左 Windows 键,并保留每个左 Windows 组合键,例如 LWin+Left/Right 等

到目前为止,我尝试过的解决方案都没有很好的效果:有时脚本不会拦截 windows 键,并且主要在默认 windows 行为和自动热键脚本行为之间做一些事情。

这是迄今为止效果最好的脚本:

$LWin::
    KeyWait, LWin, T0.3
    If !ErrorLevel {
        Send, +!{space}
    }
    Else {
        Send, {LWin Down} 
    }   
    KeyWait, LWin
Send, {LWin Up}
Return

我尝试过的事情:

试试这个:

LWin up::
If (A_PriorKey = "LWin") ; LWin was pressed alone
    Send, +!{space}
return

; In this case its necessary to define a custom combination by using "&" or "<#" 
; to avoid that LWin loses its original function as a modifier key:

<#d:: Send #d  ; <# means LWin

运行 AHK高架

你说

Sometimes the script does not intercept windows key and mostly doing something in between the default windows behavior and the autohotkey script behavior.

如果您遇到 AutoHotKey 的不确定行为,运行 它会提升,即 作为管理员

我在我的脚本中经常遇到这个问题,直到我发现 AHK 不能可靠地捕获与系统相关的快捷方式或键(它们有时有效,有时无效),除非它以管理员身份启动。最后一个不需要这个的系统是 Windows XP。问题始于 Windows 7.

  • 因此,与其创建复杂的变通脚本,不如 return 到以前 运行 不可靠的直接脚本,并使用提升的 AHK 尝试它们。

提示:如果您希望在用户每次登录时 运行 提升 AHK,运行 它使用计划任务(通过任务计划程序创建)并授予任务管理员权限。