delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/19/11:16:18

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Date: Fri, 19 Aug 2011 17:15:45 +0200
From: Samuel Thibault <samuel DOT thibault AT ens-lyon DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: Issue with inserting '@' at the command prompt.
Message-ID: <20110819151545.GA4919@type.famille.thibault.fr>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20110713190028 DOT GA4742 AT calimero DOT vinschen DOT de> <m3bowxtgt9 DOT fsf AT dalen DOT lamasti DOT net> <20110714101609 DOT GF2125 AT calimero DOT vinschen DOT de> <20110714105621 DOT GJ2853 AT lamasti DOT net> <20110714124214 DOT GE5619 AT const> <20110819023740 DOT GL4919 AT type DOT famille DOT thibault DOT fr> <20110819115019 DOT GA12612 AT calimero DOT vinschen DOT de> <20110819131459 DOT GO4919 AT type DOT famille DOT thibault DOT fr> <20110819140651 DOT GT4919 AT type DOT famille DOT thibault DOT fr> <20110819150841 DOT GB13781 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20110819150841.GB13781@calimero.vinschen.de>
User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Corinna Vinschen, le Fri 19 Aug 2011 17:08:41 +0200, a écrit :
> On Aug 19 16:06, Samuel Thibault wrote:
> > Corinna Vinschen, a écrit :
> > > On Aug 19 15:14, Samuel Thibault wrote:
> > > > Corinna Vinschen, le Fri 19 Aug 2011 13:50:19 +0200, a Ãcrit :
> > > > > >   .wVirtualKeyCode = 0x630,
> > > >
> > > > Eergl, no, that should have been 0x30 here, our code does properly masks
> > > > out the high part, I just missed that in our code.
> > > 
> > > And what about the control code?  It's a fixed 1 in your example,
> > 
> > That's only the example. 1 is obviously not hardcoded in the real source
> > code, which I have attached (I just initially wanted to avoid you having
> > to browse into the whole not-so-readable source ).
> > 
> > > but obviously it should be 6.
> > 
> > That's clearly not obvious from an altgr point of view: people use altgr
> > to type '@', so it makes sense to simulate the hit of the right alt
> > (i.e. altgr).
> 
> Typo on my part.  I meant 5, the combination of RIGHT_ALT_PRESSED and
> RIGHT_CTRL_PRESSED.

Well I understood the latter without even looking at the exact number
actually :)

> But RIGHT/LEFT CTRL should be equivalent anyway, as far as general
> typing is concerned.

CTRL, yes.

> > > > Err, do you mean LEFT_ALT_PRESSED here? Right alt is altgr in some
> > > > keyboard layouts, which is precisely what people use to type '@' in
> > > > the french layout, actually. E.g. LeftAlt-A and RightAlt-A (i.e.
> > > 
> > > I'm aware of this difference, so, no, that was a deliberate
> > > RIGHT_ALT_PRESSED.
> > 
> > But for the cases when only alt is to be pressed, this simulates a right
> > alt, which with e.g. the french layout is not the same as the left one.
> 
> Yes, just like the german one.  However, to the best of my knowledge
> there's no printable unicode char which requires to press left-alt on
> any such keyboard layout.

Yes, but there are shortcuts which use left-alt.

> That's exactly what the AltGr == right-alt key is for, isn't it?

For glyphs, yes.

For instance, alt-e would open an edition menu, while altgr-e prints the
euro symbol.

> > > However, this also works for me when using
> > > LEFT_CTRL_PRESSED and LEFT_ALT_PRESSED in the conditionals above.
> > 
> > But it won't work with DOS applications (e.g. edit). That's precisely
> > the reason why I added the special case.
> 
> Uh, ok, I see.  If you press AltGr on a keyboard layout which does not
> distinguish Alt and AltGr, (english, for instance), the AltGr key only
> emits a RIGHT_ALT_PRESSED control code.

Ok.

> On a keyboard layout which does
> distinguish them, the AltGr key emits LEFT_CTRL_PRESSED | RIGHT_ALT_PRESSED.

Ah. *that* is the part that I was missing :) I had assumed that
RIGHT_ALT meant altgr. So we'll indeed simply simulate control as well,
and it should work correctly.

Thanks!
Samuel

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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