Jump to content

need help with hotkey's


boltc
 Share

Recommended Posts

$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:))

Link to comment
Share on other sites

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