GRUB has support for both the IBM PC XT (Set 1) and IBM PC AT (Set 2) key
scan code mappings. But the driver always hardcodes to Set 1, overwriting
the mode that was queried in the grub_keyboard_controller_init() function.

This breaks keyboard mapping on machines whose firmwares are not using the
Set 1. For example, this is the case in Lenovo P71 and HP Elitebook 8770W
laptops that report key scan codes using Set 2.

Instead of hardcoding to Set 1, use the value that was queried before.

Reported-by: Renaud Métrich <rmetr...@redhat.com>
Signed-off-by: Javier Martinez Canillas <javi...@redhat.com>
---

 grub-core/term/at_keyboard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
index 597111077bd..ed2ea0904c1 100644
--- a/grub-core/term/at_keyboard.c
+++ b/grub-core/term/at_keyboard.c
@@ -165,7 +165,7 @@ set_scancodes (void)
     }
 
 #if !USE_SCANCODE_SET
-  ps2_state.current_set = 1;
+  ps2_state.current_set = grub_keyboard_orig_set;
   return;
 #else
 
-- 
2.28.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to