G'day, I haven't done anything with AHK for about 8 years, I've just recently come back to it and have found myself stuck on something. I'm trying to use a variable to define a hotkey, however I'm finding that it isn't working for me, I've tried several combinations of code to make it work and have spent some time looking at the documentation as well as some forums where people have asked questions about the KeyPress command but still can't work it out.
I have defined a key in an ini file:
and have also tried:
Here is a simplified and cut down version of the relevant lines of code in my script to show basically what I'm trying to achieve with this part of my script:
Code: Select all
;...
IniRead, Key, %A_ScriptDir%/example.ini, Example, Key
;...
KeyWait, %Key%
Goto KeyPress
Return
;...
KeyPress:
MsgBox, Perform some action here..
return
I am aware that there is a much better way to do this, but this example is an easy way to show what result I'm trying to achieve.
Can someone please give me some advice on how I can change this to get the script to do what I'm trying to do?
Thanks.