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 

Multiple Letter Hotkeys

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



Joined: 07 Oct 2005
Posts: 3

PostPosted: Fri Oct 07, 2005 2:34 pm    Post subject: Multiple Letter Hotkeys Reply with quote

I have looked everywhere and could not find anything doing this or tellnig how to do it. Can I assign a hotkey to something using two letters + other key combo, such as, Windows key+Ctrl+r+a for one hotkey and windows key+Ctrl+r+b for another.
Back to top
View user's profile Send private message
Peepsalot



Joined: 06 Oct 2005
Posts: 24

PostPosted: Fri Oct 07, 2005 4:37 pm    Post subject: Reply with quote

Try using ampersand "&"
http://www.autohotkey.com/docs/Hotkeys.htm
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Fri Oct 07, 2005 4:45 pm    Post subject: Reply with quote

...but there are physical limitations: some keyboards (e.g. Dell) cannot detect certain multiple key presses. It is safer to use key combinations, when you release the first key. It can be done with If GetKeyState("KeyName") -like cases inside the first hotkey routine.
Back to top
View user's profile Send private message
aarongoble



Joined: 07 Oct 2005
Posts: 3

PostPosted: Fri Oct 07, 2005 5:44 pm    Post subject: Reply with quote

chaining together with ampersand doesn't work. Can you give me a small example script laszlo.
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Fri Oct 07, 2005 6:04 pm    Post subject: Reply with quote

Actually, Input is better than GetKeyState
Code:
#^r::
Input key, I L1
IfEqual key,a
   MsgBox r & a
IfEqual key,b
   MsgBox r & b
Return
Back to top
View user's profile Send private message
aarongoble



Joined: 07 Oct 2005
Posts: 3

PostPosted: Fri Oct 07, 2005 6:36 pm    Post subject: Reply with quote

Thanks that little script helped me figure out what I am going to use.
#^r::
Input, userKey, I L2
If userKey = bs

So the user hits the hotkey then can type bs to run the macro.
I can add different strings to each hotkey to free up a lot of different options.
Back to top
View user's profile Send private message
deanhill1971



Joined: 30 Sep 2005
Posts: 58
Location: Fort Wayne, IN

PostPosted: Wed Nov 09, 2005 9:19 pm    Post subject: Reply with quote

I just experimented with combination keys like the following.
Code:
y & u::
   msgbox, hi there
return

Pressing 'y' and 'u' simultaneously shows the msgbox, but now my 'y' key does nothing when pressed singly. Am I running into what Laszlo wrote below? I have an IBM keyboard plugged into a Dell port replicator.
Quote:

Laszlo

...but there are physical limitations: some keyboards (e.g. Dell) cannot detect certain multiple key presses.
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Wed Nov 09, 2005 9:30 pm    Post subject: Reply with quote

help wrote:
...becomes a prefix key. Prefix keys can also be assigned their own actions ..., but their action will only be triggered when the key is released and only if you did not press any other keys while the key was begin held down
The problem is that your y key is now a prefix key with different behavior. You can define actions for it, but it won't aouto-repeat, Shift, CapsLock behaves differently with it, so it is better not to use this kind of combinations with normal keyboard keys.
Back to top
View user's profile Send private message
Decarlo110



Joined: 15 Dec 2004
Posts: 303
Location: United States

PostPosted: Wed Nov 09, 2005 9:36 pm    Post subject: Reply with quote

I can't answer your question, but try the following:
Code:
~y & u::
   msgbox, hi there
return

From the Helpfile:
Quote:
~ This hotkey's native function shouldn't be suppressed (hidden from the system) when the hotkey fires.

This feature is not supported on Windows 95/98/ME.

_________________
1) The Open Source Definition http://www.opensource.org/docs/definition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <<AutoHotkey>>
Back to top
View user's profile Send private message
Display posts from previous:   
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