Sign in to follow this  
Followers 0
boltc

need help with hotkey's

3 posts in this topic

$hotkeys = StringSplit("1,2,3,4,5,6,7,8,9,0", ",")

For $number = 0 to 10
    HotKeySet($hotkeys[$number], "_show")
Next


Func _show()

        MsgBox (4096, "test", $hotkeys)
    
EndFunc

i want to show in the msgbox what hotkey is pushed... Can someone help me?

(the code above dont work:))

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$hotkeys = StringSplit("1,2,3,4,5,6,7,8,9,0", ",")

For $number = 1 to $hotkeys[0] ; Use the variabele end so you can easily add more numbers to the Hotkey String.
    HotKeySet($hotkeys[$number], "_show")
Next


; The main loop will prevent the script from exiting immediately.
While 1
      Sleep(50) ; A little bit of sleep to prevent high CPU usage.
Wend

Func _show()
        MsgBox (4096, "test", @HotKeyPressed) ; @HotKeyPressed returns the hot key pressed. :) So this will probably work.
EndFunc

Good luck.

Edit:

Tested and it works.

Added comments.

Edited by Manadar

Share this post


Link to post
Share on other sites

it works.. thank you very much

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