Jump to content

Catching "Enter"


Recommended Posts

Hi Everybody :geek:

I tried making a small script, that recognices if someone hits "ENTER" and then sends Send("Test{enter}")

Now the Problem:

I tried it with Hotkeys:

HotKeySet("{ENTER}", "Enterhit")

While 1

Sleep(100)

WEnd

Func Enterhit()

Send("Test{enter}")

EndFunc

That didn't work because it's an endless-loop (when i hit enter, it sends the text and hits enter and so on ...)

So i tried _isPressed...

The only Problem about _isPressed is, that it doesn't "catch" the enter...i dont won't the first enter to be send :\

Is there a way to do that? :o

Link to comment
Share on other sites

HotKeySet("{ENTER}","enterfunc")
While 1
sleep(10000)
WEnd
func enterfunc()
hotkeyset("{ENTER}")
Send("Test{ENTER}")
hotkeyset("{ENTER}","enterfunc")
endfunc

--that ought to do it

~cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

Straight from the documentation for HotKeySet:

If you wish to send the captured hotkey to the active application you must unregister the hotkey before invoking Send or must use ControlSend:

; capture and pass along a keypress

HotKeySet("{Esc}", "captureEsc")

Func captureEsc()

; ... can do stuff here

HotKeySet("{Esc}")

Send("{Esc}")

HotKeySet("{Esc}", "captureEsc")

EndFunc

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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...