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 

AltGr and other special keys

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
foxer
Guest





PostPosted: Sun Mar 19, 2006 3:43 pm    Post subject: AltGr and other special keys Reply with quote

There is a problem with AltGr: Control and Alt keys aren't sent.

For instance:

<^>!m::Send +z
sends Shift z (OK)

but:

<^>!m::Send ^z
sends z (NOK)

<^>!m::Send !z
sends z (NOK)
Back to top
Titan



Joined: 11 Aug 2004
Posts: 5068
Location: imaginationland

PostPosted: Sun Mar 19, 2006 3:45 pm    Post subject: Reply with quote

edit: nvm mistake
_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")


Last edited by Titan on Sun Mar 19, 2006 4:18 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
foxer
Guest





PostPosted: Sun Mar 19, 2006 3:53 pm    Post subject: Reply with quote

Titan, you didn't understand my topic.
I gave examples followed by a part of a phrase. "sends" is an English word here.
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Mon Mar 20, 2006 1:26 pm    Post subject: Reply with quote

I've confirmed this is a bug and will try to fix it for the next release. Thanks for reporting it.

More info: As shown by the changelog, the AltGr key may be the single largest source of bugs so far. This is because of its difficult to detect whether a layout has an AltGr key; and even if you detect it, its interactions with the LControl key lead to complexities with hotkeys and Send.

The next release will also have a better method of detecting whether the current keyboard layout has an AltGr key.
Back to top
View user's profile Send private message Send e-mail
foxer
Guest





PostPosted: Mon Mar 20, 2006 8:55 pm    Post subject: Reply with quote

In fact, is this a bug from AltGr or from Send ?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Wed Mar 22, 2006 3:04 am    Post subject: Reply with quote

I believe it's caused indirectly by AltGr; but there is most likely some part of Send and/or hotkeys that mishandles AltGr in cases like these.
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Wed Mar 22, 2006 3:47 am    Post subject: Reply with quote

In case you need a workaround until it gets fixed, the following seems to work:

<^>!m::Send {LControl down}z{LControl up}
Back to top
View user's profile Send private message Send e-mail
foxer
Guest





PostPosted: Sat Mar 25, 2006 5:02 pm    Post subject: Reply with quote

Thanks Chris, that worked.
Back to top
foxer
Guest





PostPosted: Sat Mar 25, 2006 11:30 pm    Post subject: Reply with quote

Version 1.0.43.00 corrected this bug. Thanks Chris
Back to top
abg
Guest





PostPosted: Sat Mar 17, 2007 12:10 pm    Post subject: checking keyboard layout for AltGr Reply with quote

Chris wrote:
The next release will also have a better method of detecting whether the current keyboard layout has an AltGr key.


Is there a way to check AltGr key existence in AHK? In case you implemented it for the internals only, I would appreciate a built in variable like A_AltGrPresent that allows me to program a settings dialog where a user can choose all modifiers of his keyboard.
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sat Mar 17, 2007 1:44 pm    Post subject: Reply with quote

The internal detection of AltGr is somewhat complicated because the Windows API doesn't provide any way to detect it (that I know of). The AutoHotkey code waits for the user to press the AltGr key or simulate keystrokes that involve AltGr. From that, it deduces whether AltGr exists.

Because of the above, the program doesn't know instantly whether AltGr exists, so it wouldn't be reliable to provide a built-in variable like A_AltGrPresent. Even if it weren't for that, the rarity of its use would make me reluctant to build it in.

To work around this, I think a script can do something like the following, though I haven't tested it:
Code:
Send {RAlt down}
Sleep 10
HasAltGr := GetKeyState("LControl")
Send {RAlt up}

The above might have side effects depending on which window is active at the time it is run. If so, there may be workarounds, or maybe someone else can think of a better way.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports 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