Subject: SV: B19: Console input problems
From: [email-masked] (Anders Norlander)

11 Oct 1998 09:32:18 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
To: "Brad Olson" <[email-masked]>, <[email-masked]>

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
"[email-masked]" with one line of text: "help".