goranga Posted February 20, 2010 Posted February 20, 2010 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
somdcomputerguy Posted February 20, 2010 Posted February 20, 2010 (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 February 20, 2010 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
goranga Posted February 20, 2010 Author Posted February 20, 2010 Yeah I couldn't get HotKeySet("{ALT}$foo", "_Bar") to work either Also for general code maintainability/adaptability id like to keep Global $foo = {F1} vs Global $foo = "!{F1}"
kaotkbliss Posted February 20, 2010 Posted February 20, 2010 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 gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
goranga Posted February 20, 2010 Author Posted February 20, 2010 +10 post count to kaotkbliss! Works perfectly, thanks again
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now