Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/dev Add comments why delta Y of mouse input is...



details:   https://anonhg.NetBSD.org/src/rev/13bcf6e1c8d3
branches:  trunk
changeset: 366362:13bcf6e1c8d3
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Mon May 23 12:17:17 2022 +0000

description:
Add comments why delta Y of mouse input is inverted.

diffstat:

 sys/arch/x68k/dev/ms.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 32e246748b32 -r 13bcf6e1c8d3 sys/arch/x68k/dev/ms.c
--- a/sys/arch/x68k/dev/ms.c    Sun May 22 21:39:44 2022 +0000
+++ b/sys/arch/x68k/dev/ms.c    Mon May 23 12:17:17 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ms.c,v 1.36 2021/04/24 16:24:14 tsutsui Exp $ */
+/*     $NetBSD: ms.c,v 1.37 2022/05/23 12:17:17 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ms.c,v 1.36 2021/04/24 16:24:14 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ms.c,v 1.37 2022/05/23 12:17:17 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -464,7 +464,16 @@
        if (ms->ms_dy) {
                NEXT;
                fe->id = LOC_Y_DELTA;
-               fe->value = -ms->ms_dy; /* XXX? */
+               /*
+                * struct firm_events (derived from SunOS) defines
+                * moving up (forward) is positive. (see vuid_event.h)
+                * On the other hand, X680x0 mouse protocol reports
+                * moving down (backward) is positive.
+                * 
+                * Note wsmouse(9) also defines moving upward is positive,
+                * but Xorg DIX layer requires moving down is positive.
+                */
+               fe->value = -ms->ms_dy;
                firm_gettime(fe);
                ADVANCE;
                ms->ms_dy = 0;



Home | Main Index | Thread Index | Old Index