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." _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel