Jump to content

Key Pressed


 Share

Recommended Posts

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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