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 

Distinguishing alt-right and ctrl-alt-right

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



Joined: 28 May 2006
Posts: 44

PostPosted: Wed Jul 01, 2009 10:24 pm    Post subject: Distinguishing alt-right and ctrl-alt-right Reply with quote

I have a script in which alt-right is a hotkey. I define it via

Alt & Right::
---stuff---

This seems to be grabbing ctrl-alt-right events. Another program called DOORS defines ctrl-alt-right and pressing ctrl-alt-right while in DOORS has no effect. I tried to define ctrl-alt-right as another hotkey, but Autohotkey seemed to ignore it.

Thanks for the help,
Mike
Back to top
View user's profile Send private message
MasterFocus



Joined: 08 Apr 2009
Posts: 3035
Location: Rio de Janeiro - RJ - Brasil

PostPosted: Thu Jul 02, 2009 2:24 am    Post subject: Reply with quote

Read this: http://www.autohotkey.com/docs/Hotkeys.htm#Symbols

Code:
; ! is ALT
!Right::
  ; do stuff
return

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"

Antonio França
My stuff: Google Profile
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Thu Jul 02, 2009 3:03 am    Post subject: Reply with quote

MasterFocus wrote:
Read this: http://www.autohotkey.com/docs/Hotkeys.htm#Symbols

Code:
; ! is ALT
!Right::
  ; do stuff
return


I'm not sure what that has to do with my question. The "Alt & Right" form does work. Does that have something to do with Alt-Right "stealing" Ctrl-Alt-Right? I scanned the page you refer to but not easy to see anything relevant.
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 7295
Location: Australia

PostPosted: Thu Jul 02, 2009 11:05 am    Post subject: Reply with quote

Anonymous wrote:
I'm not sure what that has to do with my question.
In the time it took you to post, you could've tried the script and seen that !Right triggers only on Alt-Right, not on Ctrl-Alt-Right or any other combination of modifiers.

I suppose custom combinations (prefix_key & other_key) are so called because they are meant for use with custom prefix keys, not so much for the standard modifier keys.
Back to top
View user's profile Send private message Visit poster's website
ratsrcute



Joined: 28 May 2006
Posts: 44

PostPosted: Thu Jul 02, 2009 4:28 pm    Post subject: Reply with quote

Lexikos wrote:
Anonymous wrote:
I'm not sure what that has to do with my question.
In the time it took you to post, you could've tried the script and seen that !Right triggers only on Alt-Right, not on Ctrl-Alt-Right or any other combination of modifiers.

I suppose custom combinations (prefix_key & other_key) are so called because they are meant for use with custom prefix keys, not so much for the standard modifier keys.


I understand your frustration that I didn't just "try it", but hear me out. I'm looking for documentation and principles here. If there is some special behavior to "Alt & Right" I want to see that documented or described directly. Different programmers have different philosophies regarding debugging---for some it is sufficient to "just try something" and be happy it works. For others, it is important to have a substantial proof of the correctness of their programs. I tend to operate in the latter mode by habit, because my day job is programming robotic spacecraft. We don't just try things and hope they work. Now, this situation is not so critical, but it's still in my personality to look for documentation and principle.

I'm still hoping for an explanation. Is there some reason that Alt & Right "steals" Ctrl-Alt-Right? Is this by design?

Thanks,
Mike
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Thu Jul 02, 2009 5:15 pm    Post subject: Reply with quote

Quote:
I'm looking for documentation and principles here.
I believe this can be found here: http://www.autohotkey.com/docs/Hotkeys.htm

Examine the following concepts:
modifier symbols
custom combination of two keys

Code:
Alt & Right::
---stuff---
In this example, Alt is being used as a key, and therefore this Hotkey should execute every time Alt and Right are pressed together.

Code:
; ! is ALT
!Right::
  ; do stuff
return
In this example, Alt is being used as a modifier. Therefore, pressing Ctrl+Alt+Right should not trigger your AHK Hotkey because more modifiers are being used.

Hopefully that makes sense. Very Happy
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
ratsrcute



Joined: 28 May 2006
Posts: 44

PostPosted: Thu Jul 02, 2009 9:47 pm    Post subject: Reply with quote

Thanks for the explanation. There seems to be something else going on, however. My keyboard seems incapble of generating Ctrl+Alt+Right, never mind AutoHotkey. If I exit my AHK script, then go into this program (DOORS) and type Ctrl+Alt+Right I still get nothing. It's a Goldtouch keyboard (split style) by a company called Ovation. This may not be an AutoHotkey question any more, but can someone explain to me how to go about debugging this? Do certain keyboards behave like this, or might this be an issue in the OS?

I also don't get any response from AHK when I define !^Right.

However something like !^s works fine.

Thanks,
Mike
Back to top
View user's profile Send private message
WHACKSTER



Joined: 23 Jun 2009
Posts: 16

PostPosted: Thu Jul 02, 2009 10:08 pm    Post subject: Reply with quote

Yes it is possible for some key combinations not to work for certain keyboards because of their matrix.

Try the script with a different keyboard to be sure, I think there is a way to solve this issue but it involves soldering some diodes.
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