Jump to content

Recommended Posts

Posted

I am trying to use variables with HotKeySet. Say the code looks like this:

$hotkey1 = ^

$hotkey2 = {PGDN}

HotKeySet($hotkey1$hotkey2, "FUNCTIONNAME")

When I try to run this I get an "error in expression" message for the HotKeySet line. It works if I use just one variable, but when I combine the two variables I get the error. I looked in the help file and searched "combining variables" in the forum, but did not find the answer.

Thanks very much to anyone who can offer suggestions/advice.

Guy.

Posted

This should work:

$hotkey1 = "^{PGDN}"
HotKeySet($hotkey1, "FUNCTIONNAME")
Sleep(20000)
Exit

Func FUNCTIONNAME()
  MsgBox(0,"","Hotkey pressed")
  Exit
EndFunc

My UDFs and Tutorials:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...