This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

SV: B19: Console input problems


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@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]