Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/luna68k/stand/boot Ignore mouse packets to avoid un...



details:   https://anonhg.NetBSD.org/src/rev/f470bb4f9596
branches:  trunk
changeset: 985656:f470bb4f9596
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Sep 03 16:21:15 2021 +0000

description:
Ignore mouse packets to avoid unexpected data handled as keyboard input.

Patch from moveccr.

diffstat:

 sys/arch/luna68k/stand/boot/kbd.c |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 0eadde6185b0 -r f470bb4f9596 sys/arch/luna68k/stand/boot/kbd.c
--- a/sys/arch/luna68k/stand/boot/kbd.c Fri Sep 03 12:20:38 2021 +0000
+++ b/sys/arch/luna68k/stand/boot/kbd.c Fri Sep 03 16:21:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kbd.c,v 1.4 2015/02/14 13:06:28 tsutsui Exp $  */
+/*     $NetBSD: kbd.c,v 1.5 2021/09/03 16:21:15 tsutsui Exp $  */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -213,12 +213,23 @@
 int    shift_flag = 0;
 int    ctrl_flag  = 0;
 int    meta_flag  = 0;
+int    mouse_flag  = 0;
 
 int
 kbd_decode(uint8_t code)
 {
        unsigned int c, updown = 0;
 
+       /* ignore mouse data */
+       if (mouse_flag != 0) {
+               mouse_flag--;
+               return KC_IGNORE;
+       }
+       if ((code & 0xf8) == 0x80) {
+               mouse_flag = 2;
+               return KC_IGNORE;
+       }
+
        if (code & 0x80)
                updown = 1;
 



Home | Main Index | Thread Index | Old Index