Sign in to follow this  
Followers 0
HockeyFan

Novice Help...Test for key press

14 posts in this topic

Please Help!! :ph34r: (Novice)

How do I write a script that will loop unil the {ENTER} key is pressed?

Do

ControlDisable ( " User Information", "OK", 6)

Until <--------------------------------------------------------(the ENTER key is pressed)

ControlEnable ( " User Information", "OK", 6)

Thanks in advance! :lmao:

Share this post


Link to post
Share on other sites



see _IsPressed() in help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

see _IsPressed() in help

8)

:lmao:

My bad!

I looked in the Help file but I missed the underscore! Thanks! :ph34r:

Share this post


Link to post
Share on other sites

see _IsPressed() in help

8)

OK, now what am I doing wrong!! :ph34r:

I've used the example in the Help file but when I press the enter key, nothing happens.

Here's my script so far...:

$dll = DllOpen("C:\WINDOWS\system32\user32.dll")

Do
     ControlDisable ( " User Information", "OK", 6)
Until _IsPressed("2B", $dll)
ControlEnable ( " User Information", "OK", 6)
DllClose($dll)

:lmao:

Share this post


Link to post
Share on other sites

per help... there is an include

#Include <Misc.au3>

_IsPressed($s_hexKey[, $v_dll = 'user32.dll'])

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

per help... there is an include

#Include <Misc.au3>

_IsPressed($s_hexKey[, $v_dll = 'user32.dll'])

8)

Yes! I have that at the beginning of my script...I just did not include it in the example I posted...sorry! :">

Any further ideas?

Share this post


Link to post
Share on other sites

Until <--------------------------------------------------------(the ENTER key is pressed)

2B = EXECUTE key

you want

0D = ENTER key

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Until <--------------------------------------------------------(the ENTER key is pressed)

2B = EXECUTE key

you want

0D = ENTER key

8)

Thank you :">

Works like a charm!! :lmao:

Thanks for your help!

Share this post


Link to post
Share on other sites

Welcome

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Hi,

I think it would be better to disable the Control only one time and then do busy waiting for _isPressed Enter and If it is pressed then enable the Control.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

I think it would be better to disable the Control only one time and then do busy waiting for _isPressed Enter and If it is pressed then enable the Control.

So long,

Mega

in other words.. place this

"ControlDisable ( " User Information", "OK", 6)"

before..

"Do"

and i agree also

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

in other words.. place this

"ControlDisable ( " User Information", "OK", 6)"

before..

"Do"

and i agree also

8)

OK...do you mean:

$dll = DllOpen("C:\WINDOWS\system32\user32.dll")
ControlDisable ( " User Information", "OK", 6)
Do
    Sleep(100)
Until _IsPressed("0D", $dll)
$UserName = GUICtrlRead($UserInputBox)
ControlEnable ( " User Information", "OK", 6)
DllClose($dll)

??

Share this post


Link to post
Share on other sites

yes...

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

yes...

8)

Thank you! :lmao:

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