Jump to content

hold space auto it macro ??


Recommended Posts

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 Gude
How 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

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 by josh77
Link to comment
Share on other sites

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 by songersoft
Link to comment
Share on other sites

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 by songersoft
Link to comment
Share on other sites

  • 11 years later...
  • Developers

...11 years later ....   and also cross-posting ..... right, great start. 

Edited 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

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...