Jump to content

Recommended Posts

Posted (edited)

This script sends SPACE key when you press Middle Click of your mouse.

The function "_IsPressed" dont work like "HotKeySet", you can easily send 5 spaces or more while you keep pressing Middle Click and I want to send only one time the space key, not spamming/looping it. :ranting:

 

#include <misc.au3>

While 1
If _IsPressed(04) Then ;04 is Middle Click
Send("{SPACE}")
EndIf
Sleep(10)
WEnd
Edited by DarkBlood
  • Solution
Posted

This thread's title is "_IsPressed loop an action until key is released (up) ...".

Being pedantic, KaFu's script works when key is pressed (down).

This script works when the key is released (up).
 

#include <misc.au3>
While 1
    If _IsPressed(04) Then ;04 is Middle Click
        While _IsPressed(04) ;04 is Middle Click
            Sleep(10)
        WEnd
        Send("{SPACE}")
    EndIf
    Sleep(10)
WEnd
Posted

  On 8/1/2014 at 10:44 PM, Malkey said:

 

This thread's title is "_IsPressed loop an action until key is released (up) ...".

Being pedantic, KaFu's script works when key is pressed (down).

 

Yes, until it is released / or goes up.

Do you think the code doesn't fit the title?

Don't see any discrepancies.

In any case, thank you for the code. :)

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

  • 2 years later...
Posted

Hi,

 

yes its an old post.
But can it work for example.
Sending Space as long as the middle mouse button is pressed and when released it will stop?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...