From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MfiEE-0003Dq-27 for mharc-grub-devel@gnu.org; Mon, 24 Aug 2009 18:41:30 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfiEB-0003CN-Cx for grub-devel@gnu.org; Mon, 24 Aug 2009 18:41:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfiE7-00039a-Tn for grub-devel@gnu.org; Mon, 24 Aug 2009 18:41:27 -0400 Received: from [199.232.76.173] (port=42696 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfiE7-00039R-QW for grub-devel@gnu.org; Mon, 24 Aug 2009 18:41:23 -0400 Received: from xvm-190-8.ghst.net ([217.70.190.8]:34246 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MfiE7-0000ff-0V for grub-devel@gnu.org; Mon, 24 Aug 2009 18:41:23 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MfiE5-000566-9Y for grub-devel@gnu.org; Tue, 25 Aug 2009 00:41:21 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MfiE4-0006YA-NT for grub-devel@gnu.org; Tue, 25 Aug 2009 00:41:20 +0200 Date: Tue, 25 Aug 2009 00:41:20 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090824224120.GC25093@thorin> References: <20090812153520.GA11691@riva.ucam.org> <20090812221431.GD11691@riva.ucam.org> <20090824092406.GE11691@riva.ucam.org> <20090824122352.GB18956@thorin> <20090824220419.GA31998@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090824220419.GA31998@riva.ucam.org> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] Detect key modifier status in 'sleep --interruptible' 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: Mon, 24 Aug 2009 22:41:28 -0000 On Mon, Aug 24, 2009 at 11:04:19PM +0100, Colin Watson wrote: > +/* See http://heim.ifi.uio.no/~stanisls/helppc/bios_data_area.html for a > + description of the BIOS Data Area layout. */ > +struct grub_machine_bios_data_area > +{ > + grub_uint8_t unused1[0x17]; > + grub_uint8_t keyboard_flag_lower; /* 0x17 */ > + grub_uint8_t keyboard_flag_upper; /* 0x17 */ > + grub_uint8_t unused2[0xf0 - 0x19]; > +}; Why split the keyboard field in upper/lower? We have working 16-bit types :-) > +static int > +grub_check_keyboard (void) > +{ > + int mods = grub_getkeystatus (); > + if (mods >= 0 && (mods & GRUB_TERM_STATUS_SHIFT) != 0) > + return 1; > + > + if (grub_checkkey () >= 0 && > + GRUB_TERM_ASCII_CHAR (grub_getkey ()) == GRUB_TERM_ESC) > + return 1; > + > + return 0; > +} I'm not sure if hardcoding ESC and SHIFT here makes this a bit too ad-hoc. IIRC you had a more generic approach in mind? What does everyone think about this? -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."