From d909715f1b8dace7f4b59ca22fd4f29fdb71fd70 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Fri, 17 Aug 2018 14:34:15 +0200 Subject: [PATCH] input/ps2: drop fake right-shift scancodes Seen on X250 Description from https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html The ten grey keys Insert, Home, PgUp, Delete, End, PgDn, Up, Left, Down, Right are supposed to function regardless of the state of Shift and NumLock keys. But for an old AT keyboard the keypad keys would produce digits when Numlock was on or Shift was down. Therefore, in order to fool old programs, fake scancodes are sent: when LShift is down, and Insert is pressed, e0 aa e0 52 is sent; upon release of Insert e0 d2 e0 2a is sent. In other words, a fake LShift-up and fake LShift-down are inserted. Fixes #2888 --- repos/os/src/drivers/input/spec/ps2/ps2_keyboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/os/src/drivers/input/spec/ps2/ps2_keyboard.h b/repos/os/src/drivers/input/spec/ps2/ps2_keyboard.h index 2824b06323..fa7546ffba 100644 --- a/repos/os/src/drivers/input/spec/ps2/ps2_keyboard.h +++ b/repos/os/src/drivers/input/spec/ps2/ps2_keyboard.h @@ -153,7 +153,7 @@ class Ps2::Keyboard : public Input_driver case READ_E0_VALUE: /* drop fake shifts */ - if ((v & 0x7f) == 0x2a) { + if ((v & 0x7f) == 0x2a || (v & 0x7f) == 0x36) { reset(); return; } @@ -301,7 +301,7 @@ class Ps2::Keyboard : public Input_driver case READ_EXT: /* drop fake shifts */ - if (v == 0x12) { + if (v == 0x12 || v == 0x59) { reset(); return; }