- Report absolute mouse in Flags MOUSE_INPUT_DATA member
[HIDPARSER]
- Fix data conversion when extracting unscaled data from reports
- Fixes VBOX absolute pointing device
- Tested with VBOX 4.1.22 
- #Core-6553 #resolve

svn path=/trunk/; revision=57603
This commit is contained in:
Johannes Anderwald 2012-10-24 09:37:08 +00:00
parent e5723cc926
commit b0caef1b6b
2 changed files with 10 additions and 7 deletions

View file

@ -92,7 +92,8 @@ MouHid_GetButtonMove(
VOID
MouHid_GetButtonFlags(
IN PMOUHID_DEVICE_EXTENSION DeviceExtension,
OUT PUSHORT ButtonFlags)
OUT PUSHORT ButtonFlags,
OUT PUSHORT Flags)
{
NTSTATUS Status;
USAGE Usage;
@ -102,6 +103,7 @@ MouHid_GetButtonFlags(
/* init flags */
*ButtonFlags = 0;
*Flags = 0;
/* get usages */
CurrentUsageListLength = DeviceExtension->UsageListLength;
@ -170,7 +172,7 @@ MouHid_GetButtonFlags(
if (DeviceExtension->MouseAbsolute)
{
// mouse operates absolute
*ButtonFlags |= MOUSE_MOVE_ABSOLUTE;
*Flags |= MOUSE_MOVE_ABSOLUTE;
}
}
@ -212,6 +214,7 @@ MouHid_ReadCompletion(
NTSTATUS Status;
LONG LastX, LastY;
MOUSE_INPUT_DATA MouseInputData;
USHORT Flags;
/* get device extension */
DeviceExtension = (PMOUHID_DEVICE_EXTENSION)Context;
@ -239,13 +242,14 @@ MouHid_ReadCompletion(
MouHid_GetButtonMove(DeviceExtension, &LastX, &LastY);
/* get mouse change flags */
MouHid_GetButtonFlags(DeviceExtension, &ButtonFlags);
MouHid_GetButtonFlags(DeviceExtension, &ButtonFlags, &Flags);
/* init input data */
RtlZeroMemory(&MouseInputData, sizeof(MOUSE_INPUT_DATA));
/* init input data */
MouseInputData.ButtonFlags = ButtonFlags;
MouseInputData.Flags = Flags;
MouseInputData.LastX = LastX;
MouseInputData.LastY = LastY;

View file

@ -630,11 +630,10 @@ HidParser_GetUsageValueWithReport(
ASSERT(ReportItem->ByteOffset < ReportDescriptorLength);
//
// one extra shift for skipping the prepended report id
// FIXME: support items with variable bitlength
//
Data = 0;
Parser->Copy(&Data, &ReportDescriptor[ReportItem->ByteOffset +1], min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1)));
//Data = ReportDescriptor[ReportItem->ByteOffset + 1];
ASSERT(ReportItem->BitCount == 16);
Data = (ReportDescriptor[ReportItem->ByteOffset +1] & 0xFF) | (ReportDescriptor[ReportItem->ByteOffset +2] & 0xFF) << 8;
//
// shift data