Skip to content

Instantly share code, notes, and snippets.

@moveccr
Created August 30, 2021 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moveccr/b4bb50c35543cc8a64e55b5bc9a7cd15 to your computer and use it in GitHub Desktop.
Save moveccr/b4bb50c35543cc8a64e55b5bc9a7cd15 to your computer and use it in GitHub Desktop.
NetBSD/luna68k ブートローダでマウスを動かすと誤入力が発生する問題のパッチ
--- a/sys/arch/luna68k/stand/boot/kbd.c
+++ b/sys/arch/luna68k/stand/boot/kbd.c
@@ -213,12 +213,23 @@ static const struct kbd_keymap kbd_keymap[] = {
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment