Jump to content

Recommended Posts

Posted

I have to set max chars to _IsPressed.Example: User press "a", Script sends "a", but not only 1 "a", it sends 8 "a" chars.

I need help!

Could you post some code to let us see if we can find a problem.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

#include <Misc.au3>
While 1
    If _IsPressed("41", "user32.dll") Then
    ;I need to put here limit of chars
        FileWrite("1.txt", "a")
    EndIf
WEnd

Posted (edited)

#include <Misc.au3>
While 1
    If _IsPressed("41", "user32.dll") Then
;I need to put here limit of chars
        FileWrite("1.txt", "a")
    EndIf
WEnd
I did it like this and got only one "a"

#include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
    Sleep ( 100 )
    If _IsPressed("41", $dll) Then
        $text="a"
FileWrite("1.txt", $text)
        ExitLoop
    EndIf
WEnd
DllClose($dll)

Edit

Oops too slow again

Edited by BigDod


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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
  • Recently Browsing   0 members

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