Deleted Added
full compact
62c62
< __FBSDID("$FreeBSD: head/sys/dev/atkbdc/psm.c 281127 2015-04-06 01:04:08Z rpaulo $");
---
> __FBSDID("$FreeBSD: head/sys/dev/atkbdc/psm.c 281440 2015-04-11 18:44:07Z rpaulo $");
200a201
> int two_finger_scroll;
338a340
> int extended_buttons;
2755c2757,2763
< touchpad_buttons |= MOUSE_BUTTON2DOWN;
---
> if (pb->ipacket[4] & 0x01)
> touchpad_buttons |= MOUSE_BUTTON1DOWN;
> if (pb->ipacket[5] & 0x01)
> touchpad_buttons |= MOUSE_BUTTON3DOWN;
> if (pb->ipacket[4] & 0x02)
> touchpad_buttons |= MOUSE_BUTTON2DOWN;
> sc->extended_buttons = touchpad_buttons;
2776a2785,2791
> } else if (!sc->syninfo.directional_scrolls &&
> !sc->synaction.in_vscroll) {
> /*
> * Keep reporting MOUSE DOWN until we get a new packet
> * indicating otherwise.
> */
> touchpad_buttons |= sc->extended_buttons;
2778a2794,2797
> /* Handle ClickPad. */
> if (sc->synhw.capClickPad &&
> ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01))
> touchpad_buttons |= MOUSE_BUTTON1DOWN;
2782,2783c2801,2804
< /* Check pressure to detect a real wanted action on the
< * touchpad. */
---
> /*
> * Check pressure to detect a real wanted action on the
> * touchpad.
> */
2796c2817
<
---
> int two_finger_scroll;
2822a2844
> two_finger_scroll = sc->syninfo.two_finger_scroll;
2982,2988c3004,3024
< /* Check for horizontal scrolling. */
< if ((vscroll_hor_area > 0 &&
< synaction->start_y <= vscroll_hor_area) ||
< (vscroll_hor_area < 0 &&
< synaction->start_y >=
< 6143 + vscroll_hor_area))
< synaction->in_vscroll += 2;
---
> /*
> * Handle two finger scrolling.
> * Note that we don't rely on fingers_nb
> * as that keeps the maximum number of fingers.
> */
> if (two_finger_scroll) {
> if (w == 0) {
> synaction->in_vscroll +=
> dyp ? 2 : 0;
> synaction->in_vscroll +=
> dxp ? 1 : 0;
> }
> } else {
> /* Check for horizontal scrolling. */
> if ((vscroll_hor_area > 0 &&
> synaction->start_y <=
> vscroll_hor_area) ||
> (vscroll_hor_area < 0 &&
> synaction->start_y >=
> 6143 + vscroll_hor_area))
> synaction->in_vscroll += 2;
2990,2996c3026,3034
< /* Check for vertical scrolling. */
< if ((vscroll_ver_area > 0 &&
< synaction->start_x <= vscroll_ver_area) ||
< (vscroll_ver_area < 0 &&
< synaction->start_x >=
< 6143 + vscroll_ver_area))
< synaction->in_vscroll += 1;
---
> /* Check for vertical scrolling. */
> if ((vscroll_ver_area > 0 &&
> synaction->start_x <=
> vscroll_ver_area) ||
> (vscroll_ver_area < 0 &&
> synaction->start_x >=
> 6143 + vscroll_ver_area))
> synaction->in_vscroll += 1;
> }
2999c3037
< if (synaction->in_vscroll == 3)
---
> if (synaction->in_vscroll >= 3)
3003,3007d3040
< VLOG(5, (LOG_DEBUG,
< "synaptics: virtual scrolling: %s "
< "(direction=%d, dxp=%d, dyp=%d)\n",
< synaction->in_vscroll ? "YES" : "NO",
< synaction->in_vscroll, dxp, dyp));
3008a3042,3047
> /*
> * Reset two finger scrolling when the number of fingers
> * is different from two.
> */
> if (two_finger_scroll && w != 0)
> synaction->in_vscroll = 0;
3009a3049,3055
> VLOG(5, (LOG_DEBUG,
> "synaptics: virtual scrolling: %s "
> "(direction=%d, dxp=%d, dyp=%d, fingers=%d)\n",
> synaction->in_vscroll ? "YES" : "NO",
> synaction->in_vscroll, dxp, dyp,
> synaction->fingers_nb));
>
3249a3296
>
3463c3510
<
---
>
4111c4158
< sc->syninfo.directional_scrolls = 1;
---
> sc->syninfo.directional_scrolls = 0;
4117c4164
< "a middle-click (if 0)");
---
> "extended buttons (if 0)");
4118a4166,4181
> /*
> * Turn off two finger scroll if we have a
> * physical area reserved for scrolling or when
> * there's no multi finger support.
> */
> if (sc->synhw.verticalScroll || sc->synhw.capMultiFinger == 0)
> sc->syninfo.two_finger_scroll = 0;
> else
> sc->syninfo.two_finger_scroll = 1;
> /* hw.psm.synaptics.two_finger_scroll. */
> SYSCTL_ADD_INT(&sc->syninfo.sysctl_ctx,
> SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO,
> "two_finger_scroll", CTLFLAG_RW|CTLFLAG_ANYBODY,
> &sc->syninfo.two_finger_scroll, 0,
> "Enable two finger scrolling");
>
4521a4585,4587
> synhw.verticalScroll = (status[0] & 0x01) != 0;
> synhw.horizontalScroll = (status[0] & 0x02) != 0;
> synhw.verticalWheel = (status[0] & 0x08) != 0;
4522a4589,4599
> if (verbose >= 2) {
> printf(" Extended model ID:\n");
> printf(" verticalScroll: %d\n",
> synhw.verticalScroll);
> printf(" horizontalScroll: %d\n",
> synhw.horizontalScroll);
> printf(" verticalWheel: %d\n",
> synhw.verticalWheel);
> printf(" nExtendedButtons: %d\n",
> synhw.nExtendedButtons);
> }
4542a4620,4655
> /* Read the continued capabilities bits. */
> if (mouse_ext_command(kbdc, 0xc) != 0 &&
> get_mouse_status(kbdc, status, 0, 3) == 3) {
> synhw.capClickPad = (status[1] & 0x01) << 1;
> synhw.capClickPad |= (status[0] & 0x10) != 0;
> synhw.capDeluxeLEDs = (status[1] & 0x02) != 0;
> synhw.noAbsoluteFilter = (status[1] & 0x04) != 0;
> synhw.capReportsV = (status[1] & 0x08) != 0;
> synhw.capUniformClickPad = (status[1] & 0x10) != 0;
> synhw.capReportsMin = (status[1] & 0x20) != 0;
> synhw.capInterTouch = (status[1] & 0x40) != 0;
> synhw.capReportsMax = (status[2] & 0x02) != 0;
> synhw.capClearPad = (status[2] & 0x04) != 0;
> synhw.capAdvancedGestures = (status[2] & 0x08) != 0;
> synhw.capCoveredPad = (status[2] & 0x80) != 0;
>
> if (verbose >= 2) {
> printf(" Continued capabilities:\n");
> printf(" capClickPad: %d\n", synhw.capClickPad);
> printf(" capDeluxeLEDs: %d\n", synhw.capDeluxeLEDs);
> printf(" noAbsoluteFilter: %d\n",
> synhw.noAbsoluteFilter);
> printf(" capReportsV: %d\n", synhw.capReportsV);
> printf(" capUniformClickPad: %d\n",
> synhw.capUniformClickPad);
> printf(" capReportsMin: %d\n", synhw.capReportsMin);
> printf(" capInterTouch: %d\n", synhw.capInterTouch);
> printf(" capReportsMax: %d\n", synhw.capReportsMax);
> printf(" capClearPad: %d\n", synhw.capClearPad);
> printf(" capAdvancedGestures: %d\n",
> synhw.capAdvancedGestures);
> printf(" capCoveredPad: %d\n", synhw.capCoveredPad);
> }
> buttons += synhw.capClickPad;
> }
>