Sign in to follow this  
Followers 0
poisonkiller

Need help with _IsPressed

5 posts in this topic

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!

Share this post


Link to post
Share on other sites



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.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
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

Share this post


Link to post
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.

 

Share this post


Link to post
Share on other sites

#5 ·  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


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0