| View previous topic :: View next topic |
| Author |
Message |
foxer Guest
|
Posted: Sun Mar 19, 2006 3:43 pm Post subject: AltGr and other special keys |
|
|
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
|
Posted: Sun Mar 19, 2006 3:45 pm Post subject: |
|
|
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 |
|
 |
foxer Guest
|
Posted: Sun Mar 19, 2006 3:53 pm Post subject: |
|
|
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
|
Posted: Mon Mar 20, 2006 1:26 pm Post subject: |
|
|
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 |
|
 |
foxer Guest
|
Posted: Mon Mar 20, 2006 8:55 pm Post subject: |
|
|
| In fact, is this a bug from AltGr or from Send ? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Wed Mar 22, 2006 3:04 am Post subject: |
|
|
| 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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Wed Mar 22, 2006 3:47 am Post subject: |
|
|
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 |
|
 |
foxer Guest
|
Posted: Sat Mar 25, 2006 5:02 pm Post subject: |
|
|
| Thanks Chris, that worked. |
|
| Back to top |
|
 |
foxer Guest
|
Posted: Sat Mar 25, 2006 11:30 pm Post subject: |
|
|
| Version 1.0.43.00 corrected this bug. Thanks Chris |
|
| Back to top |
|
 |
abg Guest
|
Posted: Sat Mar 17, 2007 12:10 pm Post subject: checking keyboard layout for AltGr |
|
|
| 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
|
Posted: Sat Mar 17, 2007 1:44 pm Post subject: |
|
|
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 |
|
 |
|