Sign in to follow this  
Followers 0
IanN1990

Key Pressed

2 posts in this topic

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



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  
Followers 0