delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/06/12:19:57

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-Id: <4.3.2.7.2.20010306173557.025026f0@mail.danbbs.dk>
X-Sender: degnbol AT mail DOT danbbs DOT dk
X-Mailer: QUALCOMM Windows Eudora Version 4.3.2
Date: Tue, 06 Mar 2001 18:15:18 +0100
To: <cygwin AT cygwin DOT com>
From: Gunnar Degnbol <degnbol AT danbbs DOT dk>
Subject: Re: Patch submission for AltGr handling
In-Reply-To: <Pine.WNT.4.32.0103051604510.-140435@tiller2.ventritex.com>
References: <4 DOT 3 DOT 2 DOT 7 DOT 2 DOT 20010305211847 DOT 024e2d60 AT mail DOT danbbs DOT dk>
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019