Jump to content
Sign in to follow this  
IanN1990

Key Pressed

Recommended Posts

IanN1990

Random question

_IsPressed can be used to detect when a button is pressed, but is there any way to make it run only when a key is detected

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep(250)
    For $iX = 1 To 254
        If _IsPressed(Hex($iX), $dll) Then
            ConsoleWrite("A")
        EndIf
    Next
WEnd
DllClose($dll)

Is an example but i was wondering if there was any better way? "as i dont like the idea of a 1-254 loop every 250 mili seconds

Share this post


Link to post
Share on other sites
Valik

It's a polling function. End thread.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.