Jump to content

is this a bug


 Share

Recommended Posts

No it's not a bug.

It's kind of obvious what it does:

HotKeySet button B to a function that sends it, and it will cause a loop, over and over again.

To actually send the key that is hooked you'd have to 'unhook' it in the function.

Something like:

HotKeySet("b", "b_pressed")

While 1
Sleep(250)
WEnd

Func  b_pressed()
HotKeySet("b")
Send("b")
HotKeySet("b", "b_pressed")
EndFunc
Link to comment
Share on other sites

Or you could do something more elegant, like this:

HotKeySet("b", "_SendHotKey")

While 1
    Sleep(250)
WEnd

Func _SendHotKey()
    Local $svKey = @HotKeyPressed
    HotKeySet($svKey)
    
    TrayTip("", $svKey & " was pressed", 5)
    
    Send($svKey)
    HotKeySet($svKey, "_SendHotKey")
EndFunc

That way, you only need one function for all of your keys(if you intend to use it with several that is). :D

Edited by FreeFry
Link to comment
Share on other sites

Or you could do something more elegant, like this:

HotKeySet("b", "_SendHotKey")

While 1
    Sleep(250)
WEnd

Func _SendHotKey()
    Local $svKey = @HotKeyPressed
    HotKeySet($svKey)
    
    TrayTip("", $svKey & " was pressed", 5)
    
    Send($svKey)
    HotKeySet($svKey, "_SendHotKey")
EndFunc

That way, you only need one function for all of your keys(if you intend to use it with several that is). :D

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