Jump to content

Recommended Posts

Posted (edited)

Ok I want a function to, while the key 'A' or 'D' is pressed it will count the amount of miliseconds until the key is then released.

After it gets the time I would then like to log it into a file.

I have a script atm I just cant get out of the loop, all help is appreciated;

#include <Misc.au3>
Opt("WinTitleMatchMode", 4)
$hwnd = WinGetHandle("classname=GxWindowClassD3d")
$dll = DLLOpen("user32.dll")
Global $start, $ExitLoop

While 1 
    While _IsPressed("41" OR "44", $dll)
        $start = TimerInit()
        $ExitLoop = 1
    WEnd
    If $ExitLoop = 1 Then
        ExitLoop
    EndIf
Wend
$end = TimerDiff($start)
$file = FileOpen("C:\txt.txt", 1)
Filewrite($file, $end)
Edited by AwAke

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