Fix PS/2 MouseMan+ protocol. We have been looking at a wrong place

for the sign bit for roller movement!
This commit is contained in:
yokota 1999-06-03 12:42:10 +00:00
parent c8eab8c863
commit 53f4c06394
3 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: psm.c,v 1.9 1999/05/09 13:00:43 phk Exp $
* $Id: psm.c,v 1.10 1999/05/30 16:52:47 phk Exp $
*/
/*
@ -1838,7 +1838,7 @@ psmintr(void *arg)
if ((c & ~MOUSE_PS2_BUTTONS) == 0xc8) {
/* the extended data packet encodes button and wheel events */
x = y = 0;
z = (sc->ipacket[1] & MOUSE_PS2PLUS_ZNEG)
z = (sc->ipacket[2] & MOUSE_PS2PLUS_ZNEG)
? (sc->ipacket[2] & 0x0f) - 16 : (sc->ipacket[2] & 0x0f);
ms.button |= (sc->ipacket[2] & MOUSE_PS2PLUS_BUTTON4DOWN)
? MOUSE_BUTTON4DOWN : 0;

View File

@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: psm.c,v 1.9 1999/05/09 13:00:43 phk Exp $
* $Id: psm.c,v 1.10 1999/05/30 16:52:47 phk Exp $
*/
/*
@ -1838,7 +1838,7 @@ psmintr(void *arg)
if ((c & ~MOUSE_PS2_BUTTONS) == 0xc8) {
/* the extended data packet encodes button and wheel events */
x = y = 0;
z = (sc->ipacket[1] & MOUSE_PS2PLUS_ZNEG)
z = (sc->ipacket[2] & MOUSE_PS2PLUS_ZNEG)
? (sc->ipacket[2] & 0x0f) - 16 : (sc->ipacket[2] & 0x0f);
ms.button |= (sc->ipacket[2] & MOUSE_PS2PLUS_BUTTON4DOWN)
? MOUSE_BUTTON4DOWN : 0;

View File

@ -46,7 +46,7 @@
#ifndef lint
static const char rcsid[] =
"$Id: moused.c,v 1.25 1999/02/28 09:18:57 yokota Exp $";
"$Id: moused.c,v 1.26 1999/03/01 04:47:37 gpalmer Exp $";
#endif /* not lint */
#include <err.h>
@ -1507,7 +1507,7 @@ r_protocol(u_char rBuf, mousestatus_t *act)
if ((pBuf[0] & ~MOUSE_PS2_BUTTONS) == 0xc8) {
/* the extended data packet encodes button and wheel events */
act->dx = act->dy = 0;
act->dz = (pBuf[1] & MOUSE_PS2PLUS_ZNEG)
act->dz = (pBuf[2] & MOUSE_PS2PLUS_ZNEG)
? (pBuf[2] & 0x0f) - 16 : (pBuf[2] & 0x0f);
act->button |= ((pBuf[2] & MOUSE_PS2PLUS_BUTTON4DOWN)
? MOUSE_BUTTON4DOWN : 0);