Sign in to follow this  
Followers 0
XxXFaNtA

Catching "Enter"

5 posts in this topic

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

Share this post


Link to post
Share on other sites



Sounds like you want to remap the enter key. Then watch for the key it's being remapped to.

Sorry I don't have any code to show you.


Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


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

Share this post


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

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