mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[MOUHID]
- 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:
parent
e5723cc926
commit
b0caef1b6b
2 changed files with 10 additions and 7 deletions
|
@ -92,7 +92,8 @@ MouHid_GetButtonMove(
|
||||||
VOID
|
VOID
|
||||||
MouHid_GetButtonFlags(
|
MouHid_GetButtonFlags(
|
||||||
IN PMOUHID_DEVICE_EXTENSION DeviceExtension,
|
IN PMOUHID_DEVICE_EXTENSION DeviceExtension,
|
||||||
OUT PUSHORT ButtonFlags)
|
OUT PUSHORT ButtonFlags,
|
||||||
|
OUT PUSHORT Flags)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
USAGE Usage;
|
USAGE Usage;
|
||||||
|
@ -102,6 +103,7 @@ MouHid_GetButtonFlags(
|
||||||
|
|
||||||
/* init flags */
|
/* init flags */
|
||||||
*ButtonFlags = 0;
|
*ButtonFlags = 0;
|
||||||
|
*Flags = 0;
|
||||||
|
|
||||||
/* get usages */
|
/* get usages */
|
||||||
CurrentUsageListLength = DeviceExtension->UsageListLength;
|
CurrentUsageListLength = DeviceExtension->UsageListLength;
|
||||||
|
@ -170,7 +172,7 @@ MouHid_GetButtonFlags(
|
||||||
if (DeviceExtension->MouseAbsolute)
|
if (DeviceExtension->MouseAbsolute)
|
||||||
{
|
{
|
||||||
// mouse operates absolute
|
// mouse operates absolute
|
||||||
*ButtonFlags |= MOUSE_MOVE_ABSOLUTE;
|
*Flags |= MOUSE_MOVE_ABSOLUTE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,6 +214,7 @@ MouHid_ReadCompletion(
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
LONG LastX, LastY;
|
LONG LastX, LastY;
|
||||||
MOUSE_INPUT_DATA MouseInputData;
|
MOUSE_INPUT_DATA MouseInputData;
|
||||||
|
USHORT Flags;
|
||||||
|
|
||||||
/* get device extension */
|
/* get device extension */
|
||||||
DeviceExtension = (PMOUHID_DEVICE_EXTENSION)Context;
|
DeviceExtension = (PMOUHID_DEVICE_EXTENSION)Context;
|
||||||
|
@ -239,13 +242,14 @@ MouHid_ReadCompletion(
|
||||||
MouHid_GetButtonMove(DeviceExtension, &LastX, &LastY);
|
MouHid_GetButtonMove(DeviceExtension, &LastX, &LastY);
|
||||||
|
|
||||||
/* get mouse change flags */
|
/* get mouse change flags */
|
||||||
MouHid_GetButtonFlags(DeviceExtension, &ButtonFlags);
|
MouHid_GetButtonFlags(DeviceExtension, &ButtonFlags, &Flags);
|
||||||
|
|
||||||
/* init input data */
|
/* init input data */
|
||||||
RtlZeroMemory(&MouseInputData, sizeof(MOUSE_INPUT_DATA));
|
RtlZeroMemory(&MouseInputData, sizeof(MOUSE_INPUT_DATA));
|
||||||
|
|
||||||
/* init input data */
|
/* init input data */
|
||||||
MouseInputData.ButtonFlags = ButtonFlags;
|
MouseInputData.ButtonFlags = ButtonFlags;
|
||||||
|
MouseInputData.Flags = Flags;
|
||||||
MouseInputData.LastX = LastX;
|
MouseInputData.LastX = LastX;
|
||||||
MouseInputData.LastY = LastY;
|
MouseInputData.LastY = LastY;
|
||||||
|
|
||||||
|
|
|
@ -630,11 +630,10 @@ HidParser_GetUsageValueWithReport(
|
||||||
ASSERT(ReportItem->ByteOffset < ReportDescriptorLength);
|
ASSERT(ReportItem->ByteOffset < ReportDescriptorLength);
|
||||||
|
|
||||||
//
|
//
|
||||||
// one extra shift for skipping the prepended report id
|
// FIXME: support items with variable bitlength
|
||||||
//
|
//
|
||||||
Data = 0;
|
ASSERT(ReportItem->BitCount == 16);
|
||||||
Parser->Copy(&Data, &ReportDescriptor[ReportItem->ByteOffset +1], min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1)));
|
Data = (ReportDescriptor[ReportItem->ByteOffset +1] & 0xFF) | (ReportDescriptor[ReportItem->ByteOffset +2] & 0xFF) << 8;
|
||||||
//Data = ReportDescriptor[ReportItem->ByteOffset + 1];
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// shift data
|
// shift data
|
||||||
|
|
Loading…
Reference in a new issue