miloOmelo Posted May 23, 2013 Posted May 23, 2013 (edited) i want to press the Ins key or Numpad5 key and have it write on notepad two letters U and I (so it looks like this UI) at once and repeatedly even when not holding the hotkey , but it needs to stop when i press the hotkey again so far i have succeded on making in write UIUIUIUIUIUIUIUIUI which is ok but it only works while i hold the Ins key what i had in mind was make it start writing UIUIUIUIUIUI ..... .... without me holding the INS key down all the time , ok this can be done with a while loop like this while 1 Send("{U up}") Send("{I up}") EndIf but it needs to stop when the same hotkey is pressed again, so the same hot key that starts the thing has to make it stop this is what i got so far #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") HotKeySet("{INS}","Pressed") Func Pressed() Do Send("{U down}") Send("{I down}") Until _IsPressed("2D", $hDLL) ; Send("{U up}") ; Send("{I up}") EndFunc While 1 Sleep(10) If _IsPressed("2D", $hDLL) Then Send("{U up}") Send("{I up}") EndIf WEnd a trick would be to have the first example and pause upause the script with a hotkey but that is not efficient and not so fast in speed i searched lots of threads so far and help files with no success yet, eventhough the code might be very simple and i am missing the proper statements. looking forward to your replys , regards Edited May 23, 2013 by miloOmelo
mrflibblehat Posted May 23, 2013 Posted May 23, 2013 (edited) You mean something like this? Global $vWrite HotKeySet("{INS}", "ToggleWrite") While 1 Sleep(100) Wend Func ToggleWrite() WinActivate("Untitled - Notepad") ;~ or [CLASS:Notepad] $vWrite = Not $vWrite While $vWrite Sleep(100) Send("UI") WEnd EndFunc Edited May 23, 2013 by mrflibblehat [font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font]
miloOmelo Posted May 23, 2013 Author Posted May 23, 2013 You mean something like this? Global $vWrite HotKeySet("{INS}", "ToggleWrite") While 1 Sleep(100) Wend Func ToggleWrite() WinActivate("Untitled - Notepad") ;~ or [CLASS:Notepad] $vWrite = Not $vWrite While $vWrite Sleep(100) Send("UI") WEnd EndFunc Yes thanks you
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