I don't know exactly how to do this, Iv tried making it on my own, but it always malfunctioned badly.
So I need some help or guidance.
What I need to figure out how to make is a script that if it detects 2 keys or more being pressed at the same time then they all get prevented.
Thanks in advance.
If 2 or more keys are pressed, disable all Topic is solved
Re: If 2 or more keys are pressed, disable all Topic is solved
There could be some bugs here with upper case.
Well, you didn't say it had to be fast.
Code: Select all
list := []
Loop, 0xFF {
key := GetKeyName(Format("VK{:02X}", 0x100 - A_Index))
If key not contains Button,Wheel,Shift,Control,Alt
{ list.Push(key)
Hotkey, $%key%, Combo, On
}
}
Return
Combo:
pressed = 0
For each, key in list
pressed += GetKeyState(key, "P")
SendInput % pressed = 1 ? "{" SubStr(A_ThisHotkey, 2) "}" : ""
Return
Code: Select all
pressed := []
Loop, 0xFF {
key := GetKeyName(Format("VK{:02X}", 0x100 - A_Index))
If (key > "")
If key not contains Button,Wheel,Shift,Control,Alt
{ Hotkey, %key%, Down, On
Hotkey, %key% Up, Up, On
}
}
Return
Down:
pressed[A_ThisHotkey] := True
SendInput % pressed.Count() = 1 ? "{" A_ThisHotkey "}" : ""
Return
Up:
pressed.Delete(StrSplit(A_ThisHotkey, " ").1)
Return
Code: Select all
pressed = `n
Loop, 0xFF {
key := GetKeyName(Format("VK{:02X}", 0x100 - A_Index))
If (key > "")
If key not contains Button,Wheel,Shift,Control,Alt
{ Hotkey, %key%, Down, On
Hotkey, %key% Up, Up, On
}
}
Return
Down:
pressed := StrReplace(pressed, "`n" A_ThisHotkey "`n", "`n") A_ThisHotkey "`n"
StrReplace(SubStr(pressed, 2), "`n",, number)
SendInput % number = 1 ? "{" A_ThisHotkey "}" : ""
Return
Up:
pressed := StrReplace(pressed, "`n" StrSplit(A_ThisHotkey, " ").1 "`n", "`n")
Return
-
- Posts: 2
- Joined: 26 Jun 2022, 16:30
Re: If 2 or more keys are pressed, disable all
Thanks alot for the help, have a good day sir!