| View previous topic :: View next topic |
| Author |
Message |
ahinds
Joined: 21 Jan 2008 Posts: 3
|
Posted: Mon Jan 21, 2008 6:16 am Post subject: Creating chorded Hotkeys |
|
|
Hello,
I'm new to AHK and have read the documentation but am a bit confused on how to create a 'chorded' hotkey. The idea is that I would like to be able to navigate to gmail when I press control-i and then while holding down control (but having released i) press m.
I tried the following, but i gives a script error:
^i&m::Run www.gmail.com
Any help would be appreciated.
--Alexis |
|
| Back to top |
|
 |
Mustang
Joined: 17 May 2007 Posts: 375 Location: England
|
Posted: Mon Jan 21, 2008 4:34 pm Post subject: |
|
|
| Code: | Hotkey, ^m, Off
Return
^i::
{
KeyWait, i
Hotkey, ^m, On
KeyWait, Ctrl
Hotkey, ^m, Off
Return
}
^m::
{
Run, http://www.gmail.com/
Return
} |
|
|
| Back to top |
|
 |
ahinds
Joined: 21 Jan 2008 Posts: 3
|
Posted: Mon Jan 21, 2008 4:57 pm Post subject: |
|
|
Mustang,
Thank you so much!!! That would have taken me quite some time to figure out. If I even did even.
Thanks again,
--Alexis |
|
| Back to top |
|
 |
ahinds
Joined: 21 Jan 2008 Posts: 3
|
Posted: Mon Jan 21, 2008 5:07 pm Post subject: |
|
|
Mustang,
Actually one small problem I noticed
the ^i^m definitely works as expected. However just plain ^m also works, which it would be ideal if it didn't launch gmail. Is there a way to change that?
Thanks again!
--Alexis |
|
| Back to top |
|
 |
Mustang
Joined: 17 May 2007 Posts: 375 Location: England
|
Posted: Mon Jan 21, 2008 5:10 pm Post subject: |
|
|
Well it shouldn't do that (and for me it doesn't)
Thats what the:
| Code: | Hotkey, ^m, Off
Return |
Is for at the top |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 901
|
Posted: Mon Jan 21, 2008 7:15 pm Post subject: |
|
|
You might want to have a look at this thread:
http://www.autohotkey.com/forum/viewtopic.php?t=27683
What they asked amounts to the same thing.
But mustang's script works for me, though it's strangely written IMHO. I would write it as:
| Code: | Hotkey, ^m, Off
^i::
KeyWait, i
Hotkey, ^m, On
KeyWait, Ctrl
Hotkey, ^m, Off
Return
^m::Run, http://www.gmail.com/ |
|
|
| Back to top |
|
 |
|