From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2033 invoked by alias); 10 May 2005 06:01:07 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1893 invoked from network); 10 May 2005 06:00:56 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.9) by sourceware.org with SMTP; 10 May 2005 06:00:56 -0000 Received: (qmail 25295 invoked from network); 10 May 2005 06:00:55 -0000 Received: from localhost (HELO ?192.168.0.2?) (mitchell@127.0.0.1) by mail.codesourcery.com with SMTP; 10 May 2005 06:00:55 -0000 Message-ID: <42804E09.9060508@codesourcery.com> Date: Tue, 10 May 2005 11:45:00 -0000 From: Mark Mitchell User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Eli Zaretskii CC: bug-readline@gnu.org, gdb-patches@sources.redhat.com Subject: Re: PATCH: Use getche on Win32 References: <200505092015.j49KFoPw028903@sethra.codesourcery.com> <01c55512$Blat.v2.4$85bf3480@zahav.net.il> In-Reply-To: <01c55512$Blat.v2.4$85bf3480@zahav.net.il> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-05/txt/msg00221.txt.bz2 Eli Zaretskii wrote: >>Date: Mon, 9 May 2005 13:15:50 -0700 >>From: Mark Mitchell >>Cc: gdb-patches@sources.redhat.com >> >>Windows console semantics are different from UNIX. If we just use >>"read" to read what the user's typing, we end up blocking until a >>newline is available, and even then there are some oddities. The >>easiest thing seems to be to use the special "getche" (short for "get >>character with echo") routine which does the right thing. >> >>Reviews? > > > What happens if you press one of the special keys, like Ctrl-C or the > arrow keys or PageDown? Does getche still DTRT? Ctrl-C shows up as code 3, despite the fact that the documentation says that you can't read Ctrl-C. The arrows and such are two-byte sequences; the first byte is 0xE0, while the second byte is a letter. For example, left-arrow is 0xE0 0x50. So, I'm not sure this entirely qualifies as "DTRT", but it's not totally broken either. -- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com (916) 791-8304