Jump to content

HotKeySet and Send


Gal
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
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...