Color detection Sending a key press
Posted: 19 May 2022, 03:35
hello, I'm trying to make a script that allows me to trigger a key (hold press) when I'm hovering on a given color, this script will be triggered as long impressing a key (hold press), i tried to loop the color detection, the script is not working at all !
Code: Select all
#IfWinActive, ahk_exe Photoshop.exe
#InstallKeybdHook
Loop {
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%
}
if color = ff0000 ; Color here
#if getkeystate("Lbutton","p") ; as long im pressing Lbutton this script will run and send the b key
Send, {b}
return
#if