Jump to content
Sign in to follow this  
Gal

HotKeySet and Send

Recommended Posts

Gal

I've noticed that Send can trigger an HotKeySet,

for example if I have

HotKeySet("w", "write")

Func write()
   ; this method some times writes w and some times performs something different
   ; according to some flag or w/e
   If (flag)
      ; do something
   else
      Send("w")
endfunc

What I want to do, is have some different Send method, which never triggers the hotkeyset,

this can be done with ControlSend _IF_ I know the control I want to send it to...

in my case, I don't.

I simply want to send the key to the currently focused control exactly the way it would have

if it was the Send method.

What I was thinking is maybe ControlSend with some parameteres can have like a @currentlyFocused autoit keyword which automatically gives me the ID or name that is needed for ControlSend to send to the currently focused control, however I am not that familiar with the autoit keywords so if anyone could point out the correct format for this or a smarter way to implement what I need I would really appreciate it...

Thanks

Gal

Edited by Gal

Share this post


Link to post
Share on other sites
AdmiralAlkex

Hi and Welcome to the forums!

Just unset the HotKeySet() before you Send() and then set it back.

HotKeySet("a", "_test")

While 1
    Sleep(1000)
WEnd

Func _test()
    HotKeySet("a")
    Send("abc")
    HotKeySet("a", "_test")
EndFunc
Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites
Gal

Awesome, thanks ;)

I read that part in the help file but I guess I thought I could only unset the hotkey outside a function.

Thanks again :)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.