HID mouse descriptor problem

I am developing a virtual mouse driver. In the hid descriptor for the mouse, I am using relative position for X,Y. To make the mouse stay in same position, I have to pass the logical minimum value (0x81) and for values like 0x85 it moves towards +ve direction by little bit.

How do I make the mouse move in -ve direction? Shouldnt it like for 0x00 it stays at same position and moves based on sign of value supplied?

Enclosing the descriptor I am using in case my descriptor is wrong:

0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x02, // USAGE (Mouse)
0xA1, 0x01, // COLLECTION (Application)
0x85, 0x04, // REPORT_ID (2)
0x09, 0x01, // USAGE (Pointer)
0xA1, 0x00, // COLLECTION (Physical)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x03, // USAGE_MAXIMUM (Button 3)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x95, 0x03, // REPORT_COUNT (3)
0x75, 0x01, // REPORT_SIZE (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x05, // REPORT_SIZE (5)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x15, 0x81, // LOGICAL_MINIMUM (-127)
0x25, 0x7F, // LOGICAL_MAXIMUM (127)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x02, // REPORT_COUNT (2)
0x81, 0x06, // INPUT (Data,Var,Rel)
0xC0, // END_COLLECTION
0xC0 // END_COLLECTION

The descriptor looks ok to me

What does your descriptor data struct look like?

How do I make the mouse move in -ve direction? Shouldnt it like for
0x00 it stays at same position and moves based on sign of value
supplied?

Yes I would think so

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-393901-
xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, December 25, 2009 1:56 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] HID mouse descriptor problem

I am developing a virtual mouse driver. In the hid descriptor for the
mouse, I am using relative position for X,Y. To make the mouse stay in
same position, I have to pass the logical minimum value (0x81) and for
values like 0x85 it moves towards +ve direction by little bit.

How do I make the mouse move in -ve direction? Shouldnt it like for
0x00 it stays at same position and moves based on sign of value
supplied?

Enclosing the descriptor I am using in case my descriptor is wrong:

0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x02, // USAGE (Mouse)
0xA1, 0x01, // COLLECTION (Application)
0x85, 0x04, // REPORT_ID (2)
0x09, 0x01, // USAGE (Pointer)
0xA1, 0x00, // COLLECTION (Physical)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x03, // USAGE_MAXIMUM (Button 3)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x95, 0x03, // REPORT_COUNT (3)
0x75, 0x01, // REPORT_SIZE (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x05, // REPORT_SIZE (5)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x15, 0x81, // LOGICAL_MINIMUM (-127)
0x25, 0x7F, // LOGICAL_MAXIMUM (127)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x02, // REPORT_COUNT (2)
0x81, 0x06, // INPUT (Data,Var,Rel)
0xC0, // END_COLLECTION
0xC0 // END_COLLECTION


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer