Hi
Just got the Image Splash working, example;
F1::SplashImage, C:\Picture.bmp, b
F2::SplashImage, Off
But, I would like to splash the image by PRESSING (and holding down) the F1 key,
and
run the SplashImage, Off command by RELEASING the F1 key.
How is this done?
thanks,
Image Splash
Re: Image Splash
Code: Select all
F1::
SplashImage, C:\Picture.bmp, b
KeyWait, F1
SplashImage, Off
return
Re: Image Splash
@boiler has a good solution. Here's a more complicated solution just to show the different approaches to the same end result.
Code: Select all
#SingleInstance, Force
SplashToggle := 0
F1::
SplashToggle := 1
While (GetKeyState("F1", "P")) {
If (SplashToggle) {
SplashImage, C:\Picture.bmp, B
SplashToggle := 0
}
}
SplashImage, Off
return
Re: Image Splash
TheDewd: Note that the toggle is just adding unnecessary complication.
(and using GetKeyState and a loop that just waits for a key release is easily accomplished by KeyWait)
I agree it's good to show multiple approaches, though. There are cases where you want to use a loop like you've shown, especially when you need to perform some code while waiting for the release.
Code: Select all
F1::
SplashImage, C:\Picture.bmp, B
While (GetKeyState("F1", "P"))
continue
SplashImage, Off
return
I agree it's good to show multiple approaches, though. There are cases where you want to use a loop like you've shown, especially when you need to perform some code while waiting for the release.
Re: Image Splash
Hi,
and thanks for all the great stuff!
SimPlayer
and thanks for all the great stuff!
SimPlayer