Module Name:    src
Committed By:   tsutsui
Date:           Fri Sep  3 16:21:15 UTC 2021

Modified Files:
        src/sys/arch/luna68k/stand/boot: kbd.c

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

Patch from moveccr.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/luna68k/stand/boot/kbd.c
diff -u src/sys/arch/luna68k/stand/boot/kbd.c:1.4 src/sys/arch/luna68k/stand/boot/kbd.c:1.5
--- src/sys/arch/luna68k/stand/boot/kbd.c:1.4	Sat Feb 14 13:06:28 2015
+++ src/sys/arch/luna68k/stand/boot/kbd.c	Fri Sep  3 16:21:15 2021
@@ -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 @@ static const struct kbd_keymap kbd_keyma
 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;
 

Reply via email to