Jump to content

Recommended Posts

Posted

Hi Ive been having trouble with a script Ive been writing and would appreciate any help.

I have been unable to set a get hotkeyset() to work with alt, ctrl or shift modifiers and keys defined in variables.

For example

Global $foo = "{f1}"

HotKeySet($foo, "_Bar")

works great, f1 press triggers the function _bar

However if I want to catch ALT + f1 the following does not work

Global $foo = "{f1}"

HotKeySet("!$foo", "_Bar")

I would like to keep the F1 hotkey in a $var so that it is tidy and easy to change down the road.

Thanks in advance :mellow:

Posted (edited)

I was able to get it to work by defining $foo like this Global $foo = "!{F1}".

However, this works like you more intended,

Global $foo = "{F1}"
HotKeySet("{ALT}$foo", "_Bar")

EDIT: Well now I can't get it to work that way.. My eyes must've been screwin w/ me, I thought for sure it was working a minute ago..

Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Posted

Yeah I couldn't get

HotKeySet("{ALT}$foo", "_Bar")

to work either :mellow:

Also for general code maintainability/adaptability id like to keep

Global $foo = {F1}

vs

Global $foo = "!{F1}"

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