josh77 Posted May 22, 2011 Share Posted May 22, 2011 hey guys is it possible to create an script that when i hold SPACE the macro hits space buttom several times until i release the SPACE and it stops ?? if so ... how can i do that ?? Link to comment Share on other sites More sharing options...
BrewManNH Posted May 22, 2011 Share Posted May 22, 2011 Doesn't your computer do that on its own? It's called autorepeat. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
josh77 Posted May 22, 2011 Author Share Posted May 22, 2011 (edited) yeah but i need that for an app ... so i need a macro . Edited May 22, 2011 by josh77 Link to comment Share on other sites More sharing options...
E1M1 Posted May 22, 2011 Share Posted May 22, 2011 try HotKeySet("{space down}", "SomeFunc") edited Link to comment Share on other sites More sharing options...
josh77 Posted May 22, 2011 Author Share Posted May 22, 2011 (edited) guys all i need is a macro that when i press and hold letter X for example the macro will press several times the spacebar for me until i release the X and it stops ... thats all i need , i tried many times and i cant make that macro work , can someone help me out whit that ?? how would u guys make that script ?? HotKeySet( "{x}", "_somefunc" ) While 1 Sleep(10) wend Func _somefunc() Send("space down") Send("space down") Send("space down") Send("space down") EndFunc something like that but that one if i stop the macro it will keep hitting space even after im done ... i need a macro that will hits space while i hold and stop when i release the X . or maybe what the other guys said earlier and autorepeater for the spacebar ... im really stucked right now ... anyway Thanks for reading , i hope someone can help me whit this =] Edited May 22, 2011 by josh77 Link to comment Share on other sites More sharing options...
Xandy Posted May 22, 2011 Share Posted May 22, 2011 (edited) Here try these apples event triggered when spacebar is pressed will send $spacerepeat amount of spacebar key presses $spacerepeatdelay is the delay between spacebar key presses 1000 equals about one second and 500 would be about 1/2 a second good luck #include <Misc.au3> #include <GUIConstantsEx.au3> $spacerepeat= 10 $spacerepeatdelay= 1000 $hgui= GUICreate("send space app", 200, 60) GUISetState();shows the gui window do $guimsg= GUIGetMsg() if _IsPressed("20") Then for $i=0 to $spacerepeat-1 $timer= TimerInit() while TimerDiff($timer)<$spacerepeatdelay wend send("{space}") next endif until $guimsg= $GUI_EVENT_CLOSE Edited May 22, 2011 by songersoft Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Xandy Posted May 22, 2011 Share Posted May 22, 2011 (edited) If you want to use the 'x' key to trigger the event replace the _ispressed("20") with _ispressed("58") a complete list is in the help file just look up _ispressed. I added the gui dialog for a method of program termination. You can remove all the gui crap if you want and the program/script whatever will still work. the _ispressed responds like a global hotkey except the triggering keypress is not removed from the windows event que, but you can use any key such as scroll-lock or F11 Edited May 22, 2011 by songersoft Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
josh77 Posted May 23, 2011 Author Share Posted May 23, 2011 Thanks songersoft its perfect ... thank you . =] Link to comment Share on other sites More sharing options...
Scott337 Posted December 12, 2022 Share Posted December 12, 2022 Xandy when i let go of space the script doesn't stop playing can you help me out a bit Link to comment Share on other sites More sharing options...
Developers Jos Posted December 12, 2022 Developers Share Posted December 12, 2022 (edited) ...11 years later .... and also cross-posting ..... right, great start. Edited December 12, 2022 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts