delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/10/11/09:32:18

From: anorland AT hem2 DOT passagen DOT se (Anders Norlander)
Subject: SV: B19: Console input problems
11 Oct 1998 09:32:18 -0700 :
Message-ID: <000a01bdf4eb$fd6fdae0$b6fc09a4.cygnus.gnu-win32@wmdata.wmdata.se>
Mime-Version: 1.0
To: "Brad Olson" <olsonda AT pilot DOT msu DOT edu>, <gnu-win32 AT cygnus DOT com>

I think the problem in the keyboard input routine (in the cygwin library)
is that when reading keyboard events you get one event when a key
is pressed and one event when the key is released. The problem seems
to be that when ENTER/RETURN is pressed the input reading routine
just reads the first event and forgets about the next (release) event
which in turn is read by the next `read' in the script.
The same problem occurred to me when I developed a software that
read console input events at the low level.
This problem also appears (at least to me) when I start a program with bash
that expects a line of input from the keyboard, an extra CR is read by the program.
That is quite annoying because you never get a chance to type anything.


Brad Olson wrote:

>I have noticed this same problem with scripts. Bash doesn't always flush the input buffer
>before reading and one gets CR "bounce." The 19.1 update of cygwinb19.dll doesn't seem to help.
>
>Have your found any fixes?
>
>Thanks,
>Brad
>
>> 1)  I have a configure script that does READs for user input.  The first
>> read works correctly, but the second does not even pause for input. 
>> It's as if the CR was not removed from the input buffer.  This happens
>> with or without TTY support.


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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