LWin up::
If (A_PriorKey = "LWin") ; LWin was pressed alone
Send, #d ; go to desktop
return
; In this case it's necessary to define a custom combination by using "&" or "<#"
; to avoid that LWin loses its original function as a modifier key:
<#a:: Send, #a ; <# means LWin
LWin:: ; intercept the Left-Win key
WinMinimizeAll ; minimize all windows
WinActivate, Program Manager ; activate the desktop
Send {LWin down} ; send Left-Win down
KeyWait, LWin ; wait for Left-Win key up
Send {LWin up} ; set Left-Win key up
您可以使用右键 Win 键 (RWin) 执行相同操作。
安装 AutoHotKey 后,将上面的文字放在一个.ahk文件中,然后双击它进行测试。您可以通过右键单击托盘栏中的绿色 H 图标并选择退出来停止脚本。要让它在登录时运行,请将其放在 Startup 组中: C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup。
下面的AutoHotkey脚本将拦截 Left-Win 键,最小化所有窗口并激活桌面,然后将 Left-Win 键设置为向下。它将等待释放 Left-Win 键以将其设置为向上状态,因此它将与将来按下的键组合使用,直到释放 Win 键:
您可以使用右键 Win 键 (RWin) 执行相同操作。
安装 AutoHotKey 后,将上面的文字放在一个
.ahk
文件中,然后双击它进行测试。您可以通过右键单击托盘栏中的绿色 H 图标并选择退出来停止脚本。要让它在登录时运行,请将其放在 Startup 组中:C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
。