StudioMaker Posted June 28, 2017 Posted June 28, 2017 Anyone knows how i can make a push key? Like if u hold down it it works and when you realese the key, it stops
Xandy Posted June 29, 2017 Posted June 29, 2017 (edited) Run script and immediately press and hold F2. #include <misc.au3> $key_code = "71" $key_name = "F2" ConsoleWrite(@CRLF & "Press and hold: " & $key_name) ; This Sleep() gives the User time to press key Sleep(1200) $sec = -1 While _IsPressed($key_code) Sleep(10); Don't burn processor: NOTE this Sleep would not be required if GUIGetMsg() was in loop ; This If condition prevents console spam that could collect beyond the press of the key If $sec <> @SEC Then $sec = @SEC ConsoleWrite(@CRLF & $key_name & " is pressed " & @MIN & ": " & $sec) EndIf WEnd; _IsPressed($key_code) Edited June 29, 2017 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now