Jump to content

Pressing custom key


Guest Ajantis
 Share

Recommended Posts

Guest Ajantis

Hi everyone.

I have a problem with HotKeySet command. I'd like to make a script which takes a single letter from ini file and then uses this letter with conjuction with alt button to execute a function. And everything is fine except one thing. I don't know how to make HotKeySet to accept data from variable. I mean I'd like to do something like that:

HotKeySet ("!" + $key, "function")

It's ok, I don't get any error but when I press alt+z for example nothing happenes... I even tried to declare the $key variable manualy but that doesn't seem to help. Could someone give me some advice how to do that? Thx

Link to comment
Share on other sites

If the $key variable contains only a single letter, such as "z", then you can join the strings together with the & operator. Please also note that you should use lower-case letters unless you want to press alt-shift-z. "!z" is not the same as "!Z".

To join the strings, you put the & symbol between them. Your end result looks like:

HotKeySet("!" & $key, "function")

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

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