summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinay Bondhugula <vinayb@vmware.com>2008-01-19 09:07:16 -0800
committerVinay Bondhugula <vinayb@vmware.com>2008-01-19 09:07:16 -0800
commitca3eb5abeb187a1e40ff7c36bf87d52efb999be9 (patch)
treee8e222b44bfe3fc31259e29c04747d355bb3a872
parentca4cc3fed99457add3935f8a063558b51e816d74 (diff)
Fix an old sign bug for the relative mode
Higher order bits for the X and Y inputs (which could be set in case of a relative mouse) were being zeroed off in VMMouseClient_GetInput. This change fixes it.
-rw-r--r--src/vmmouse_client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vmmouse_client.c b/src/vmmouse_client.c
index 5f27e54..f34c223 100644
--- a/src/vmmouse_client.c
+++ b/src/vmmouse_client.c
@@ -267,9 +267,11 @@ VMMouseClient_GetInput (PVMMOUSE_INPUT_DATA pvmmouseInput) {
pvmmouseInput->Flags = (packetInfo & 0xffff0000) >> 16;
pvmmouseInput->Buttons = (packetInfo & 0x0000ffff);
- pvmmouseInput->X = vmpc.out.vEbx & 0xffff;
- pvmmouseInput->Y = vmpc.out.vEcx & 0xffff;
+ /* Note that Z is always signed, and X/Y are signed in relative mode. */
+ pvmmouseInput->X = (int)vmpc.out.vEbx;
+ pvmmouseInput->Y = (int)vmpc.out.vEcx;
pvmmouseInput->Z = (int)vmpc.out.vEdx;
+
/*
* Return number of packets (including this one) in queue.
*/