Jump to content

hotkeysend !+^ modifiers and $vars


goranga
 Share

Recommended Posts

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:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

this works

Global $foo = "{F1}"

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

while 1

Sleep(10)

wend

Func _Bar()

MsgBox(0,"","It Works!")

EndFunc

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

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