Mail Archives: cygwin/2001/03/06/12:19:57
Hi Jason,
At 16:10 05-03-2001 -0800, Jason Tiller wrote:
>Hi, Gunnar, :)
>
>We're talking about how to determine if the right <ALT> key (called
>AltGr sometimes) should be used to generate META or not:
Yes.
> > At 19:44 05-03-2001 +0100, Corinna Vinschen wrote:
> > >if (PRIMARYLANGID (LOWORD (GetKeyboardLayout (0)) == LANG_ENGLISH)
> > >should work.
>
> > This checks if any characters are produced using the altgr key
> > (altgr is converted to ctrl+alt):
>
> > altgr = FALSE;
> > for (i = 32; i < 256; i++) {
> > vk = VkKeyScan((char)i);
> > if (vk != -1 && (vk & 0x600) == 0x600) { /* ctrl+alt */
> > altgr = TRUE;
> > break;
> > }
> > }
>
>Thanks for the info. However, I'm not sure I understand, Gunnar. You
>say flat out that AltGr is converted to <CTRL>+<ALT>... does this mean
>that international keyboards can't use any of the 'Control-Meta'
>keybindings in bash because the "meta-ness" is removed and AltGr
>substituted instead? I'm confused!
In most programs ctrl+alt works exactly the same as altgr on international
keyboards. Ctrl+alt+'2' and altgr+'2' gives me '@'. See the doc for
VkKeyScan(). bash is different. ctrl+alt does not produce any special
characters, except for ctrl+alt+'¨' which gives '~', which is a dead key
and thus can't be killed by Cygwin. It is the same key as the ']' key on US
keyboards. I think ctrl+META should work mostly ok, otherwise somebody
would have noticed.
>I was also wondering if you're implying that the VkKeyScan() technique
>is a *better* choice than the GetKeyboardLayout() strategy?
I think it is better to check if windows uses the altgr key for anything,
instead of assuming that no english keyboard variant has one and that all
non-english keyboards has one. E.g. on an English/UK keyboard, altgr+'a' is
'á'.
Gunnar
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -