Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pckbport Extended buttons are reported separate from...



details:   https://anonhg.NetBSD.org/src/rev/2f86fcccce2a
branches:  trunk
changeset: 931628:2f86fcccce2a
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Apr 27 22:31:47 2020 +0000

description:
Extended buttons are reported separate from touchpad buttons, so track
button press / release state separate from touch events.

diffstat:

 sys/dev/pckbport/synaptics.c    |  31 ++++++++++++++++++++++++-------
 sys/dev/pckbport/synapticsvar.h |   8 +++++++-
 2 files changed, 31 insertions(+), 8 deletions(-)

diffs (89 lines):

diff -r c048fd29ed35 -r 2f86fcccce2a sys/dev/pckbport/synaptics.c
--- a/sys/dev/pckbport/synaptics.c      Mon Apr 27 20:46:01 2020 +0000
+++ b/sys/dev/pckbport/synaptics.c      Mon Apr 27 22:31:47 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: synaptics.c,v 1.64 2020/03/31 19:08:19 nia Exp $       */
+/*     $NetBSD: synaptics.c,v 1.65 2020/04/27 22:31:47 jmcneill Exp $  */
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.64 2020/03/31 19:08:19 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.65 2020/04/27 22:31:47 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1010,19 +1010,29 @@
                            psc->packet[3], psc->packet[4], psc->packet[5]);
 
                        if ((psc->packet[4] & SYN_1BUTMASK) != 0)
-                               sp.sp_left = PMS_LBUTMASK;
+                               sc->ext_left = PMS_LBUTMASK;
+                       else
+                               sc->ext_left = 0;
 
                        if ((psc->packet[4] & SYN_3BUTMASK) != 0)
-                               sp.sp_middle = PMS_MBUTMASK;
+                               sc->ext_middle = PMS_MBUTMASK;
+                       else
+                               sc->ext_middle = 0;
 
                        if ((psc->packet[5] & SYN_2BUTMASK) != 0)
-                               sp.sp_right = PMS_RBUTMASK;
+                               sc->ext_right = PMS_RBUTMASK;
+                       else
+                               sc->ext_right = 0;
 
                        if ((psc->packet[5] & SYN_4BUTMASK) != 0)
-                               sp.sp_up = 1;
+                               sc->ext_up = 1;
+                       else
+                               sc->ext_up = 0;
 
                        if ((psc->packet[4] & SYN_5BUTMASK) != 0)
-                               sp.sp_down = 1;
+                               sc->ext_down = 1;
+                       else
+                               sc->ext_down = 0;
                } else {
                        /* Left/Right button handling. */
                        sp.sp_left = psc->packet[0] & PMS_LBUTMASK;
@@ -1102,6 +1112,13 @@
                        sp.sp_middle = 0;
                }
 
+               /* Overlay extended button state */
+               sp.sp_left |= sc->ext_left;
+               sp.sp_right |= sc->ext_right;
+               sp.sp_middle |= sc->ext_middle;
+               sp.sp_up |= sc->ext_up;
+               sp.sp_down |= sc->ext_down;
+
                switch (synaptics_up_down_emul) {
                case 1:
                        /* Do middle button emulation using up/down buttons */
diff -r c048fd29ed35 -r 2f86fcccce2a sys/dev/pckbport/synapticsvar.h
--- a/sys/dev/pckbport/synapticsvar.h   Mon Apr 27 20:46:01 2020 +0000
+++ b/sys/dev/pckbport/synapticsvar.h   Mon Apr 27 22:31:47 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: synapticsvar.h,v 1.9 2019/06/02 08:55:00 blymn Exp $   */
+/*     $NetBSD: synapticsvar.h,v 1.10 2020/04/27 22:31:47 jmcneill Exp $       */
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -89,6 +89,12 @@
        int     history_x[SYN_MAX_FINGERS][SYN_HIST_SIZE];
        int     history_y[SYN_MAX_FINGERS][SYN_HIST_SIZE];
        int     history_z[SYN_MAX_FINGERS][SYN_HIST_SIZE];
+
+       char    ext_left;
+       char    ext_right;
+       char    ext_middle;
+       char    ext_up;
+       char    ext_down;
 };
 
 int pms_synaptics_probe_init(void *vsc);



Home | Main Index | Thread Index | Old Index