delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/18/22:38:14

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Date: Fri, 19 Aug 2011 04:37:40 +0200
From: Samuel Thibault <samuel DOT thibault AT ens-lyon DOT org>
To: cygwin AT cygwin DOT com
Subject: Issue with inserting '@' at the command prompt.
Message-ID: <20110819023740.GL4919@type.famille.thibault.fr>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <m3fwmammpu DOT fsf AT dalen DOT lamasti DOT net> <20110713130550 DOT GH13500 AT calimero DOT vinschen DOT de> <20110713133713 DOT GD4018 AT const> <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>
MIME-Version: 1.0
In-Reply-To: <20110714124214.GE5619@const>
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

Samuel Thibault, le Thu 14 Jul 2011 14:42:14 +0200, a écrit :
> Lars Bjørndal, le Thu 14 Jul 2011 12:56:21 +0200, a écrit :
> > BRLTTY has a cut & paste facility. It sometimes doesn't paste all
> > characters inside cygwin. Pasting an att sign into a shell prompt, the
> > terminal beeps, and no character is written. Doing the same thing
> > after exiting bash, but still with BRLTTY running and in a cmd
> > session, the att sign is printed.
> 
> I don't have the time to investigate now, but I can say that depending
> on whether it could open the terminal through CONIN$, brltty uses
> WriteConsoleInputW (or WriteConsoleInputA if not available) or SendInput
> for this.

In the case at stake it is WriteConsoleInputW. Let me explain a simpler
case (pasting is the same)

- the user presses '@' on his braille keyboard (ascii 0x40).
- brltty wants to synthesize it.
- brltty calls VkKeyScanW('@') to get the corresponding virtual key,
  0x0630 on an azerty keyboard, which means altgr (controlkeystate 1) +
  virtualkey 0x30
- brltty calls MapVirtualKey(vk, 0) to get the corresponding scancode,
  0x11 on a standard PC keyboard.
- brltty thus calls WriteConsoleInputW, passing it a KEY_EVENT_RECORD
  structure:
  .bKeyDown = 1,
  .wRepeatCount = 1,
  .wVirtualKeyCode = 0x630,
  .wVirtualScanCode = 0x11,
  .uChar.UnicodeChar = 0x40,
  .dwControlKeyState = 1,

and then the same with bKeyDown = 0.

This correctly inserts an '@' in a plain windows console with the
windows cmd, but with a windows console with the cygwin or mingw shell,
this beeps and does not insert anything.

Any idea?

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