Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IqsDC-0005hV-59 for mharc-grub-devel@gnu.org; Sat, 10 Nov 2007 10:25:30 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IqsDA-0005du-9p for grub-devel@gnu.org; Sat, 10 Nov 2007 10:25:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IqsD8-0005Zy-Hx for grub-devel@gnu.org; Sat, 10 Nov 2007 10:25:27 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IqsD8-0005Zb-Cy for grub-devel@gnu.org; Sat, 10 Nov 2007 10:25:26 -0500 Received: from smtp-vbr11.xs4all.nl ([194.109.24.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IqsD8-0001vQ-0B for grub-devel@gnu.org; Sat, 10 Nov 2007 10:25:26 -0500 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr11.xs4all.nl (8.13.8/8.13.8) with ESMTP id lAAFPMVc094260 for ; Sat, 10 Nov 2007 16:25:22 +0100 (CET) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <472B9CBF.9030702@t-online.de> <87ir4bla7w.fsf@xs4all.nl> <4735AD9B.5090401@t-online.de> Mail-Copies-To: mgerards@xs4all.nl Date: Sat, 10 Nov 2007 16:25:56 +0100 In-Reply-To: <4735AD9B.5090401@t-online.de> (Christian Franke's message of "Sat, 10 Nov 2007 14:09:47 +0100") Message-ID: <87y7d6i0l7.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: [PATCH] Fix grub-emu curses KEY_* mapping X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2007 15:25:28 -0000 Christian Franke writes: > Marco Gerards wrote: > >> Christian Franke writes: >> >>> Curses function keys do not work in grub-emu, this patch fixes this in >>> grub_ncurses_getkey(). >>> >> >> Ha! I once noticed this and forgot to document this bug :( >> >> >>> Another approach would be to remove the scancode translation in >>> grub_console_getkey(), and check for GRUB_CONSOLE_KEY_* in >>> grub_cmdline_get() instead. The GRUB_CONSOLE_KEY_* definitions are >>> already platform specific. >>> >> >> Yes, this is really weird! All archs define these macros and expect >> for i386-pc none of them are used. I actually wonder if any of those >> work :-) >> >> > > Even on i386-pc, GRUB_CONSOLE_KEY_* are only used once in the > translation table of grub_console_getkey(). The defines are not part > of the console interface definition. > > I would suggest to remove the defines from all > include/grub/PLATFORM/console.h. The GRUB_CONSOLE_KEY_* in > i386/pc/startup.S can be replaced with the constants itself. The other definitions have to be used. I do not like using constant values in asm/C code, instead I like using macros for this because in that case its meaning is obvious. >>> ... >>> + /* XXX: return GRUB_CONSOLE_KEY_* does not work here, >>> + grub_cmdline_get() does not check for these constants. >>> + At least on i386-pc, GRUB_CONSOLE_KEY_* are in fact keyboard >>> + scancodes which are converted into control chars by >>> + grub_console_getkey(). */ >>> + >>> >> >> I do not think this comment is needed. You explained it in the >> email. I do not like comments that explain why we aren't doing some >> things, it is usually better to explain why we do something if it is a >> hack or not obvious. In this case I prefer no comment. >> >> >>> switch (c) >>> { >>> case KEY_LEFT: >>> - c = GRUB_CONSOLE_KEY_LEFT; >>> + c = 2; /*GRUB_CONSOLE_KEY_LEFT*/ >>> break; >>> >> >> Please just remove the comment. As this appears to be wrong anyways >> :-) >> >> > > Done. > > Christian > > 2007-11-10 Christian Franke > > * util/console.c (grub_ncurses_getkey): Change curses KEY_* mapping, > now return control chars instead of GRUB_CONSOLE_KEY_* constants. > This fixes the problem that function keys did not work in grub-emu. This looks fine to me. Now we have to wait for the paperwork :-/ -- Marco