• 获取 KeyFreeze
  • 2026-02-27 09:40:00
  • ; 分享个我的ahk脚本,win+f1锁定键盘,esc退出,也可以ctrl+alt+del退出

    ; —————————————–Win+Esc 锁屏

    #Esc::SendMessage, 0x112, 0xF170, 2,,Program Manager ; 0x112 WM_SYSCOMMAND, 0xF170 SC_MONITORPOWER, 2 MonitorPowerOff

    ; —————————————–Win+F1 锁键、鼠、触摸板

    #F1::

    InputLock()

    Return

    InputLock(){

    KeyWait Control

    KeyWait Alt

    KeyWait Shift

    KeyWait LWin

    KeyWait RWin

    KeyWait, Esc

    KeyWait, Tab

    KeyWait, CapsLock

    Run, %windir%\System32\SystemSettingsAdminFlows.exe EnableTouchPad 0

    BlockInput, On

    Progress, BWM1000zh-1fm60CTFF0000, , Locked, WindowsScreenLock, Arial

    WinSet, TransColor, F0F0F0, WindowsScreenLock ahk_class AutoHotkey2

    ; KeyWait, Space, D

    ; KeyWait, Capslock, D

    KeyWait, Esc, D

    Run, %windir%\System32\SystemSettingsAdminFlows.exe EnableTouchPad 1

    BlockInput, Off

    Progress, Off

    }

    #If WinExist(“WindowsScreenLock ahk_class AutoHotkey2, Locked”)

    Esc::Return

    #If