oSamplex Posted July 31, 2014 Share Posted July 31, 2014 :~ Purely an Example #Include <Misc.au3> While 1 While _IsPressed(09) ;~ 09 = TAB Send("{TAB}") sleep(2500) WEnd sleep(100) WEnd How can I make an Toggle with an key that will be also send, without reactivate itself. So while I'm pressing TAB it will send TAB repeatedly, but it would stop after I unpressed TAB. I have tried '_WinAPI_GetAsyncKeyState()' but it still reactivates itself, and thus a infinite loop. I hope there are other options that won't interfere, so this works. Thanks in advance. Link to comment Share on other sites More sharing options...
JohnOne Posted July 31, 2014 Share Posted July 31, 2014 Use HotkeySet. Unset when enter func, reset when exit func. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
computergroove Posted July 31, 2014 Share Posted July 31, 2014 2 Examples that work to toggle on and off 2 different function calls ;HotKeySet("Key to press", Function to call) Global $PressTab Global $Paused HotKeySet("{F1}","PressTab") HotKeySet("{PAUSE}","TogglePause") While 1 Sleep(100) WEnd Func PressTab() $PressTab = NOT $PressTab While $PressTab Send("{TAB}") Sleep(50) WEnd EndFunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',350,0) WEnd ToolTip("") EndFunc Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
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