Jump to content

_IsPressed loop an action until key is released (up) and i just want to work as HotKeySet


Go to solution Solved by KaFu,

Recommended Posts

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

  • Solution
Link to comment
Share on other sites

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

 

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. :)

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • 2 years later...

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
 Share

×
×
  • Create New...