Open trajano opened 2 years ago
I didn't notice keys getting stuck with this script, until I started hammering all CPU cores with another script. The analogous AHK script worked fine under such pressure.
Yes I noticed the same as well. It is when I do a number of other things. But it is hard to pin down.
In your test harness, what would happen if you increased priority or level? Tried it on mine, for most of the day it was ok when I set it to 100 but got stuck again just now. :(
I am going to try a different approach and see if it pans out
@ahk.hotkey("XButton2")
def scroll_up():
#while ahk.is_key_pressed("XButton2"):
while not ahk.wait_key_released("XButton2", 0.010):
ahk.send("{WheelUp}")
@ahk.hotkey("XButton1")
def scroll_down():
while not ahk.wait_key_released("XButton1", 0.010):
ahk.send("{WheelDown}")
I also took out priority for now to see if it needs it or not
No luck got stuck still, will try priority=1000
to see if it helps (no luck still)
For now, I'm running two AHKs the Python to do some OpenRGB integration and another one that will do the problematic states
#NoEnv
#InstallKeybdHook
#SingleInstance
SetCapsLockState, AlwaysOff
SetNumLockState, AlwaysOn
CapsLock::return
Launch_Mail::
While GetKeyState("Launch_Mail") {
Send {LButton}
Sleep, 100
}
return
Browser_Search::
While GetKeyState("Browser_Search") {
Send {WheelUp}
Sleep, 10
}
return
#If !WinActive("ahk_exe Overwatch.exe") and !WinActive("GUNDAM EVOLUTION")
XButton2::
While GetKeyState("XButton2", "p") {
Send {WheelUp}
Sleep, 10
}
return
XButton1::
While GetKeyState("XButton1", "p") {
Send {WheelDown}
Sleep, 10
}
return
#If
I remapped the side buttons of my mouse to the mouse wheel but it sometimes locks.
Using is_key_pressed_logical does not work