AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Creating chorded Hotkeys

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ahinds



Joined: 21 Jan 2008
Posts: 3

PostPosted: Mon Jan 21, 2008 6:16 am    Post subject: Creating chorded Hotkeys Reply with quote

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

--Alexis
Back to top
View user's profile Send private message
Mustang



Joined: 17 May 2007
Posts: 375
Location: England

PostPosted: Mon Jan 21, 2008 4:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
ahinds



Joined: 21 Jan 2008
Posts: 3

PostPosted: Mon Jan 21, 2008 4:57 pm    Post subject: Reply with quote

Mustang,

Thank you so much!!! That would have taken me quite some time to figure out. If I even did even. Wink

Thanks again,

--Alexis
Back to top
View user's profile Send private message
ahinds



Joined: 21 Jan 2008
Posts: 3

PostPosted: Mon Jan 21, 2008 5:07 pm    Post subject: Reply with quote

Mustang,

Actually one small problem I noticed Wink

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
View user's profile Send private message
Mustang



Joined: 17 May 2007
Posts: 375
Location: England

PostPosted: Mon Jan 21, 2008 5:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
ManaUser



Joined: 24 May 2007
Posts: 901

PostPosted: Mon Jan 21, 2008 7:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group