Sign in to follow this  
Followers 0
JMRA

Hotkeyset

10 posts in this topic

Dear all,

This is my first topic and I want to say that I found a very incredible and powerfull tool - AUTOIT, for that I want to congratulate and thank to all contributors.

My main question is about using HotKeySet. Running example I am not able to set HotKey using compiled version.

I just need to echo <> when I press < but it does nor work. Can you help me ?

Thanks

Share this post


Link to post
Share on other sites



if you have a script... show us, maybe we can find the error as to why it wont compile

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Dear all,

This is my first topic and I want to say that I found a very incredible and powerfull tool - AUTOIT, for that I want to congratulate and thank to all contributors.

My main question is about using HotKeySet. Running example I am not able to set HotKey using compiled version.

I just need to echo <> when I press < but it does nor work. Can you help me ?

Thanks

My guess, is that you need the script to run in the background at all times? My next guess is you did the mistake I did.

So you need this in your script:

While 1
Sleep (100)
WEnd

Here is an example of one of mine. Note the ORDER of the While loop and where HotKeySet is located.

HotKeySet("^q", "Activate_ACT")
HotKeySet("^w", "Activate_Eudora")

;;;;;;;; Body of program would go here;;;;;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;


;********************************************************************************

Func Activate_ACT()
Opt("WinTitleMatchMode",1)
$title = WinGetTitle("")
WinWait("ACT!","")
If Not WinActive("ACT!","") Then WinActivate("ACT!","")
WinWaitActive("ACT!","")
Return
EndFunc


Func Activate_Eudora()
Opt("WinTitleMatchMode",1)
$title = WinGetTitle("")
WinWait("Eudora","")
If Not WinActive("Eudora","") Then WinActivate("Eudora","")
WinWaitActive("Eudora","")
Return
EndFunc

Share this post


Link to post
Share on other sites

if you have a script... show us, maybe we can find the error as to why it wont compile

8)

Here is what I have done

HotKeySet("{<}", "keys")

While 1

Sleep (100)

WEnd

Func keys()

Send("{<}{>}")

EndFunc

Thank you

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Here is what I have done

HotKeySet("{<}", "keys")

While 1

Sleep (100)

WEnd

Func keys()

Send("{<}{>}")

EndFunc

Thank you

Maybe

HotKeySet("{F7}", "keys")
While 1
Sleep (100)
WEnd

Func keys()
    Send("<>")
   EndFunc
Edited by Infinitex0

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites

Or if you want to keep it as <:

HotKeySet("<", "keys")
While 1
Sleep (100)
WEnd

Func keys()
    HotKeySet ("<")
    Send("<>")
    HotKeySet ("<", "keys")
EndFunc

Share this post


Link to post
Share on other sites

Why the second HotKeySet? :think:


The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Step by step (original code):

1. You press "<"

2. It calls function keys()

3. Function keys() presses "<" which calls function keys() again.

4. The newly called Function keys() presses "<" which calls function keys() yet again.

And so on... and on... and on.... (infinite recursion)

Therefore, you must do as greenmachine did. Use

HotKeySet ("<")
to disable the hotkey before re-enabling it with
HotKeySet ("<", "keys")

#)

EDIT: Typo(s)

Edited by nfwu

Share this post


Link to post
Share on other sites

Oh.


The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites

Thank you to everybody for code you have sent.

Problem was with my lack of understanding about sintaxe. I hope to have learned.

Best regards,

JMRA

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