这几天被卡键折磨的欲仙欲死,之前做的卡键助手逐渐不够用了,因为我发现现在卡键不仅仅是修饰键,甚至是字母也会卡键
比如这样,胎折磨人了,所以做了个独立的卡键自救工具,不仅回复修饰键,还可以弹起字母
卡键助手截图
只是给了gui的样板自己根据需求改
源码
; 一个卡键检测助手,并对所有可能卡的键发送一个up,疑似卡键的时候试试
gui,add,Button,g大哥求别卡,大哥求别卡
Gui,+Owner -Caption +AlwaysOnTop +HwndZYGui border -DPIScale
gui,show,
Return
大哥求别卡:
Gosub,到底谁卡了
Gosub, 大哥求你别卡了
Gosub, 重启保平安还不行嘛
Gosub,到底谁卡了
MsgBox,尝试向所有可能卡键的按键发送了弹起的指令如果没有成功的话就只能测试一下适用ahk管理器重启了
; Gosub srfreload
Return
到底谁卡了:
if GetKeyState("Shift")
MsgBox At least one Shift key is down.
if GetKeyState("Ctrl")
MsgBox At least one Ctrl key is down.
if GetKeyState("Alt")
MsgBox At least one Alt key is down.
if GetKeyState("Capslock")
MsgBox At least one Capslock key is down.
Return
大哥求你别卡了:
Send, {Shift up}
Send, {Ctrl Up}
Send, {CapsLock up}
Send, {Alt up}
send,{Space Up}
Loop 26{
str:= Chr(Asc("a") + A_Index - 1)
SendInput, {%str% up}
}
loop 10{
num:=A_Index-1
SendInput, {%num% up}
}
Return
重启保平安还不行嘛:
DetectHiddenWindows On
if !(A_IsAdmin || InStr(DllCall("GetCommandLine", "str"), ".exe"" /r"))
Run % "*RunAs " (s:=A_IsCompiled ? "" : A_AhkPath " /r ") """" A_ScriptFullPath """" (s ? "" : " /r")
selfPID := DllCall("GetCurrentProcessId")
WinGet, id, List, ahk_class AutoHotkey
Loop, %id% {
this_id := id%A_Index%
WinGet, this_pid, PID, ahk_id %this_id%
if (this_pid != selfPID)
{
WinGetTitle, this_title, ahk_id %this_id%
fPath := RegExReplace(this_title, " - AutoHotkey v[\d.]+$")
PostMessage, 0x111, 65303,,, % fPath " ahk_pid " this_pid
}
}
Return