FreeBSD Bugzilla – Attachment 8804 Details for
Bug 18293
[psm] [patch] lack of versapad mouse wheel emulation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.40 KB, created by
dan
on 2000-04-29 18:40:09 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
dan
Created:
2000-04-29 18:40:09 UTC
Size:
2.40 KB
patch
obsolete
>*** /usr/src/sys/isa/psm.c Wed Mar 1 11:30:36 2000 >--- psm.c Sat Apr 29 09:13:59 2000 >*************** >*** 168,173 **** >--- 168,174 ---- > int button; /* the latest button state */ > int xold; /* previous absolute X position */ > int yold; /* previous absolute Y position */ >+ int scrolling; /* emulating mouse wheel */ > }; > devclass_t psm_devclass; > #define PSM_SOFTC(unit) ((struct psm_softc*)devclass_get_softc(psm_devclass, unit)) >*************** >*** 1951,1973 **** > if (y0 & 0x800) > y0 -= 0x1000; > if (sc->flags & PSM_FLAGS_FINGERDOWN) { >! x = sc->xold - x0; >! y = y0 - sc->yold; >! if (x < 0) /* XXX */ >! x++; >! else if (x) >! x--; >! if (y < 0) >! y++; >! else if (y) >! y--; > } else { > sc->flags |= PSM_FLAGS_FINGERDOWN; > } > sc->xold = x0; > sc->yold = y0; > } else { > sc->flags &= ~PSM_FLAGS_FINGERDOWN; > } > c = ((x < 0) ? MOUSE_PS2_XNEG : 0) > | ((y < 0) ? MOUSE_PS2_YNEG : 0); >--- 1952,2002 ---- > if (y0 & 0x800) > y0 -= 0x1000; > if (sc->flags & PSM_FLAGS_FINGERDOWN) { >! #if defined(MOUSE_VERSA_SCROLL) >! /* >! * Support for mouse wheel emulation >! */ >! #define MOUSE_VERSA_SCROLL >! if (sc->scrolling) { >! z = (sc->yold-y0)/MOUSE_VERSA_SCROLLSTEP; >! #if defined(MOUSE_VERSA_FRACTIONAL_SCROLL) >! /* >! * We might not have 'consumed' all of the change >! * in y because of the division by SCROLLSTEP >! * so save it for the next mouse movement. >! */ >! y0 = sc->yold-z*8; >! #endif /* defined(MOUSE_VERSA_FRACTIONAL_SCROLL) */ >! } else { >! #endif /* defined(MOUSE_VERSA_SCROLL) */ >! x = sc->xold - x0; >! y = y0 - sc->yold; >! if (x < 0) /* XXX */ >! x++; >! else if (x) >! x--; >! if (y < 0) >! y++; >! else if (y) >! y--; >! #if defined(MOUSE_VERSA_SCROLL) >! } >! #endif /* defined(MOUSE_VERSA_SCROLL) */ > } else { > sc->flags |= PSM_FLAGS_FINGERDOWN; >+ #if defined(MOUSE_VERSA_SCROLL) >+ if (x0<MOUSE_VERSA_RIGHT_MARGIN) { >+ sc->scrolling = 1; >+ } >+ #endif /* defined(MOUSE_VERSA_SCROLL) */ > } > sc->xold = x0; > sc->yold = y0; > } else { > sc->flags &= ~PSM_FLAGS_FINGERDOWN; >+ #if defined(MOUSE_VERSA_SCROLL) >+ sc->scrolling = 0; >+ #endif /* defined(MOUSE_VERSA_SCROLL) */ > } > c = ((x < 0) ? MOUSE_PS2_XNEG : 0) > | ((y < 0) ? MOUSE_PS2_YNEG : 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18293
: 8804 |
8805