Jump to content

HotKeySet for multiple keys?


kev51773
 Share

Recommended Posts

Hi!

Try this example:

; #### by JScript - 09/09/2012 ####

_HotKeySetEx("{ESC}", "_Exit")

_HotKeySetEx("{F1}|{F2}|{F3}|{F4}", "_Example")

While 1
    Sleep(100)
WEnd

Func _Example()
    MsgBox(4096, "Example", "Multiple hotkeys set")
EndFunc

Func _HotKeySetEx($sKeys, $sFunction)
    Local $asSplit

    $asSplit = StringSplit($sKeys, "|")
    If @error Then
        Return HotKeySet($sKeys, $sFunction)
    EndIf

    For $i = 1 To $asSplit[0]
        HotKeySet($asSplit[$i], $sFunction)
    Next
    Return 1
EndFunc

Func _Exit()
    Exit
EndFunc

Regards,

João Carlos.

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

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