From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11666 invoked by alias); 12 Jun 2005 08:43:04 -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 11639 invoked by uid 22791); 12 Jun 2005 08:42:59 -0000 Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 12 Jun 2005 08:42:59 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-207-5.inter.net.il [83.130.207.5]) by romy.inter.net.il (MOS 3.5.8-GR) with ESMTP id BMU09810 (AUTH halo1); Sun, 12 Jun 2005 11:42:44 +0300 (IDT) Date: Sun, 12 Jun 2005 08:43:00 -0000 Message-Id: From: Eli Zaretskii To: Mark Kettenis CC: mark@codesourcery.com, gdb-patches@sources.redhat.com, bug-readline@gnu.org In-reply-to: <200506120731.j5C7VMNO030966@elgar.sibelius.xs4all.nl> (message from Mark Kettenis on Sun, 12 Jun 2005 09:31:22 +0200 (CEST)) Subject: Re: PATCH: Readline for MinGW Reply-to: Eli Zaretskii References: <200506081742.j58Hg6O0017392@sethra.codesourcery.com> <200506120731.j5C7VMNO030966@elgar.sibelius.xs4all.nl> X-SW-Source: 2005-06/txt/msg00120.txt.bz2 > Date: Sun, 12 Jun 2005 09:31:22 +0200 (CEST) > From: Mark Kettenis > CC: gdb-patches@sources.redhat.com, bug-readline@gnu.org > > 2. The arrow keys use different extended key sequences on Windows than > on POSIX systems; we introduce readline macros to transform the > Windows sequences into their POSIX equivalents. This approach > again confines the Windows-isms to a single point. > > Huh? AFAIK, POSIX doesn't say anything about arrow keys or the > sequences produced by it. Yes, "ANSI" would be a better term here. > + #ifdef __MINGW32__ > + /* Under Windows, when an extend key (like an arrow key) is > + pressed, getch() will return 0xE0 followed by a code for the > + extended key. We use macros to transform those into the normal > + UNIX sequences for these keys. */ > + > + /* Up arrow. */ > + rl_macro_bind ("\340H", "\033[A", map); > + /* Left arrow. */ > + rl_macro_bind ("\340K", "\033[D", map); > + /* Right arrow. */ > + rl_macro_bind ("\340M", "\033[C", map); > + /* Down arrow. */ > + rl_macro_bind ("\340P", "\033[B", map); > + #endif > > It has "\34" and "\033" on the same line so I get confused whether > "\34" is octal or not... That's not "\34", that's "\340". Which I guess explains the other confusion: > Also, I don't see any trace of the 0xE0 you mention in the comment. 340 in octal is E0 in hex. I.e., the up arrow, for example, produces two characters: 0xE0 followed by H.