Date: Thu, 6 Oct 2016 01:01:00 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306746 - head/sys/dev/atkbdc Message-ID: <201610060101.u96110AJ004299@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gonzo Date: Thu Oct 6 01:01:00 2016 New Revision: 306746 URL: https://svnweb.freebsd.org/changeset/base/306746 Log: Fix extended buttons support on synaptic clickpad Fix regression introduced by r306355 on synaptic clickpads with extended buttons (buttons stopped working) PR: 205690 Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru> Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Thu Oct 6 00:51:27 2016 (r306745) +++ head/sys/dev/atkbdc/psm.c Thu Oct 6 01:01:00 2016 (r306746) @@ -2750,7 +2750,9 @@ proc_synaptics(struct psm_softc *sc, pac static int touchpad_buttons; static int guest_buttons; static finger_t f[PSM_FINGERS]; - int w, id, nfingers, ewcode; + int w, id, nfingers, ewcode, extended_buttons; + + extended_buttons = 0; /* TouchPad PS/2 absolute mode message format with capFourButtons: * @@ -2863,7 +2865,8 @@ proc_synaptics(struct psm_softc *sc, pac if (pb->ipacket[1] & 0x02) guest_buttons |= MOUSE_BUTTON3DOWN; - ms->button = touchpad_buttons | guest_buttons; + ms->button = touchpad_buttons | guest_buttons | + sc->extended_buttons; } goto SYNAPTICS_END; @@ -2933,30 +2936,26 @@ proc_synaptics(struct psm_softc *sc, pac /* Middle Button */ if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01) touchpad_buttons |= MOUSE_BUTTON2DOWN; - } else if (sc->synhw.capExtended && sc->synhw.capClickPad) { - /* ClickPad Button */ - if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01) - touchpad_buttons = MOUSE_BUTTON1DOWN; } else if (sc->synhw.capExtended && (sc->synhw.nExtendedButtons > 0)) { /* Extended Buttons */ if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x02) { if (sc->syninfo.directional_scrolls) { if (pb->ipacket[4] & 0x01) - touchpad_buttons |= MOUSE_BUTTON4DOWN; + extended_buttons |= MOUSE_BUTTON4DOWN; if (pb->ipacket[5] & 0x01) - touchpad_buttons |= MOUSE_BUTTON5DOWN; + extended_buttons |= MOUSE_BUTTON5DOWN; if (pb->ipacket[4] & 0x02) - touchpad_buttons |= MOUSE_BUTTON6DOWN; + extended_buttons |= MOUSE_BUTTON6DOWN; if (pb->ipacket[5] & 0x02) - touchpad_buttons |= MOUSE_BUTTON7DOWN; + extended_buttons |= MOUSE_BUTTON7DOWN; } else { if (pb->ipacket[4] & 0x01) - touchpad_buttons |= MOUSE_BUTTON1DOWN; + extended_buttons |= MOUSE_BUTTON1DOWN; if (pb->ipacket[5] & 0x01) - touchpad_buttons |= MOUSE_BUTTON3DOWN; + extended_buttons |= MOUSE_BUTTON3DOWN; if (pb->ipacket[4] & 0x02) - touchpad_buttons |= MOUSE_BUTTON2DOWN; - sc->extended_buttons = touchpad_buttons; + extended_buttons |= MOUSE_BUTTON2DOWN; + sc->extended_buttons = extended_buttons; } /* @@ -2984,9 +2983,13 @@ proc_synaptics(struct psm_softc *sc, pac * Keep reporting MOUSE DOWN until we get a new packet * indicating otherwise. */ - touchpad_buttons |= sc->extended_buttons; + extended_buttons |= sc->extended_buttons; } } + /* Handle ClickPad */ + if (sc->synhw.capClickPad && + ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01)) + touchpad_buttons |= MOUSE_BUTTON1DOWN; if (sc->synhw.capReportsV && nfingers > 1) f[0] = (finger_t) { @@ -3023,7 +3026,7 @@ proc_synaptics(struct psm_softc *sc, pac if (id >= nfingers) PSM_FINGER_RESET(f[id]); - ms->button = touchpad_buttons | guest_buttons; + ms->button = touchpad_buttons; /* Palm detection doesn't terminate the current action. */ if (!psmpalmdetect(sc, &f[0], nfingers)) { @@ -3034,6 +3037,8 @@ proc_synaptics(struct psm_softc *sc, pac VLOG(2, (LOG_DEBUG, "synaptics: palm detected! (%d)\n", f[0].w)); } + ms->button |= extended_buttons | guest_buttons; + SYNAPTICS_END: /* * Use the extra buttons as a scrollwheel
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610060101.u96110AJ004299>