On Mon, Dec 30, 2013 at 08:47:25AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > On 29.12.2013 08:04, Josh Triplett wrote: > > + term->data = grub_efi_locate_protocol(&simple_text_input_ex_guid, NULL); > This will find the first handle that provides > EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL, not necessarily the same as normal > console and you may inadvertently switch to another console. You have to > look for protocols on input handle.
Will do in v2. > > + if (shift_state & (GRUB_EFI_RIGHT_SHIFT_PRESSED | > GRUB_EFI_LEFT_SHIFT_PRESSED)) > > + result |= GRUB_TERM_SHIFT; > The keys which have natural meaning for shifted version never should > receive GRUB_TERM_SHIFT. E.g. Shift+d should give 'D', not > 'd'|GRUB_TERM_SHIFT. > Easiest way is to add GRUB_TERM_SHIFT only if GRUB_TERM_EXTENDED is > already present. The EFI interface already does that; the documentation for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL explicitly states that it will not return the shift modifiers for shift+character combinations that compose into a single Unicode character. So, shift+'d' will indeed show up as 'D' with shift not set, while shift+left will show up as shift+left. I did explicitly test that case; it works exactly as it should. Also, filtering on GRUB_TERM_EXTENDED wouldn't give the right results for things like shift+space, shift+tab, or shift+backspace, since the corresponding unshifted characters don't have GRUB_TERM_EXTENDED set. > What about providing keystatus function? The protocol doesn't have a function to return the current modifier state, only to return a character with accompanying modifiers. - Josh Triplett _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel