重新映射winKey + <anyKey>
,同时仍可以锁定计算机
答案1
我将锁定快捷方式设置为ctrl + F12
(您可以将其更改为任何您喜欢的)。
AutohotkeyV1 脚本:(以管理员身份运行)
#InstallKeybdHook
; Disable win + l key locking (This line must come before any hotkey assignments in the .ahk file)
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 1
;CTRL + F12 to lock computer
^F12::
; Renable locking
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 0
; Lock the computer
DllCall("LockWorkStation")
;after locking workstation force a reload of this script which effectively disables Win + L locking the computer again
Reload