Jump to content

Need help with _IsPressed


Recommended Posts

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

Link to comment
Share on other sites

CODE

#include <Misc.au3>

While 1

If _IsPressed("41", "user32.dll") Then

;I need to put here limit of chars

FileWrite(@ScriptDir & "\1.txt", "a")

EndIf

Sleep ( 250 )

WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

#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

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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