Blame SOURCES/0318-at_keyboard-Fix-keyboards-that-report-IBM-PC-AT-scan.patch

a7e0e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a7e0e3
From: Javier Martinez Canillas <javierm@redhat.com>
a7e0e3
Date: Fri, 6 Nov 2020 14:14:24 +0100
a7e0e3
Subject: [PATCH] at_keyboard: Fix keyboards that report IBM PC AT scan codes
a7e0e3
MIME-Version: 1.0
a7e0e3
Content-Type: text/plain; charset=UTF-8
a7e0e3
Content-Transfer-Encoding: 8bit
a7e0e3
a7e0e3
GRUB has support for both the IBM PC XT (Set 1) and IBM PC AT (Set 2) key
a7e0e3
scan code mappings. But the driver always hardcodes to Set 1, overwriting
a7e0e3
the mode that was queried in the grub_keyboard_controller_init() function.
a7e0e3
a7e0e3
This breaks keyboard mapping on machines whose firmwares are not using the
a7e0e3
Set 1. For example, this is the case in Lenovo P71 and HP Elitebook 8770W
a7e0e3
laptops that report key scan codes using Set 2.
a7e0e3
a7e0e3
Instead of hardcoding to Set 1, use the value that was queried before.
a7e0e3
a7e0e3
Reported-by: Renaud Métrich <rmetrich@redhat.com>
a7e0e3
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
a7e0e3
---
a7e0e3
 grub-core/term/at_keyboard.c | 2 +-
a7e0e3
 1 file changed, 1 insertion(+), 1 deletion(-)
a7e0e3
a7e0e3
diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
a7e0e3
index f0a986eb176..ff36b21932d 100644
a7e0e3
--- a/grub-core/term/at_keyboard.c
a7e0e3
+++ b/grub-core/term/at_keyboard.c
a7e0e3
@@ -165,7 +165,7 @@ set_scancodes (void)
a7e0e3
     }
a7e0e3
 
a7e0e3
 #if !USE_SCANCODE_SET
a7e0e3
-  ps2_state.current_set = 1;
a7e0e3
+  ps2_state.current_set = grub_keyboard_orig_set;
a7e0e3
   return;
a7e0e3
 #else
a7e0e3