AutoHotkey Community

It is currently May 27th, 2012, 4:53 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Multiple Letter Hotkeys
PostPosted: October 7th, 2005, 3:34 pm 
Offline

Joined: October 7th, 2005, 3:23 pm
Posts: 3
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 5:37 pm 
Offline

Joined: October 6th, 2005, 7:25 am
Posts: 24
Try using ampersand "&"
http://www.autohotkey.com/docs/Hotkeys.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 5:45 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
...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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 6:44 pm 
Offline

Joined: October 7th, 2005, 3:23 pm
Posts: 3
chaining together with ampersand doesn't work. Can you give me a small example script laszlo.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 7:04 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 7:36 pm 
Offline

Joined: October 7th, 2005, 3:23 pm
Posts: 3
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 9th, 2005, 10:19 pm 
Offline

Joined: September 30th, 2005, 5:15 pm
Posts: 58
Location: Fort Wayne, IN
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 9th, 2005, 10:30 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 9th, 2005, 10:36 pm 
Offline

Joined: December 15th, 2004, 10:24 pm
Posts: 303
Location: United States
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>>


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO and 75 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group