From: Johannes Anderwald Date: Wed, 28 Dec 2011 17:18:56 +0000 (+0000) Subject: [USB-BRINGUP] X-Git-Tag: backups/usb-bringup@55523~23 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=6717a4ecfee633f4b782f52a9902f16b13c6a358 [USB-BRINGUP] - Fix up / down button detection - Fix move detection. Mouse changes are now detected - Mouse does not yet work in Vbox, as mouclass driver is for unknown reasons not connecting to the mouhid, needs to be investigated - Tested in VBox 4.1.4 + ReactOS mouhid.sys svn path=/branches/usb-bringup/; revision=54775 --- diff --git a/drivers/hid/mouhid/mouhid.c b/drivers/hid/mouhid/mouhid.c index d58c51a50df..4087b4be53b 100644 --- a/drivers/hid/mouhid/mouhid.c +++ b/drivers/hid/mouhid/mouhid.c @@ -10,7 +10,7 @@ #include "mouhid.h" -static USHORT MouHid_ButtonDownFlags[] = +static USHORT MouHid_ButtonUpFlags[] = { MOUSE_LEFT_BUTTON_DOWN, MOUSE_RIGHT_BUTTON_DOWN, @@ -19,7 +19,7 @@ static USHORT MouHid_ButtonDownFlags[] = MOUSE_BUTTON_5_DOWN }; -static USHORT MouHid_ButtonUpFlags[] = +static USHORT MouHid_ButtonDownFlags[] = { MOUSE_LEFT_BUTTON_UP, MOUSE_RIGHT_BUTTON_UP, @@ -41,12 +41,12 @@ MouHid_GetButtonMove( *LastY = 0; /* get scaled usage value x */ - Status = HidP_GetScaledUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_X, (PLONG)&LastX, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + Status = HidP_GetScaledUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_X, (PLONG)LastX, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); /* FIXME handle error */ ASSERT(Status == HIDP_STATUS_SUCCESS); /* get scaled usage value y */ - Status = HidP_GetScaledUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Y, (PLONG)&LastY, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + Status = HidP_GetScaledUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Y, (PLONG)LastY, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); /* FIXME handle error */ ASSERT(Status == HIDP_STATUS_SUCCESS); @@ -225,7 +225,7 @@ MouHid_ReadCompletion( } } - DPRINT1("[MOUHID] LastX %lu LastY %lu Flags %x ButtonData %x\n", MouseInputData.LastX, MouseInputData.LastY, MouseInputData.ButtonFlags, MouseInputData.ButtonData); + DPRINT1("[MOUHID] LastX %ld LastY %ld Flags %x ButtonData %x\n", MouseInputData.LastX, MouseInputData.LastY, MouseInputData.ButtonFlags, MouseInputData.ButtonData); /* dispatch mouse action */ MouHid_DispatchInputData(DeviceExtension, &MouseInputData); @@ -412,6 +412,8 @@ MouHid_DeviceControl( /* get current stack location */ IoStack = IoGetCurrentIrpStackLocation(Irp); + DPRINT1("[MOUHID] DeviceControl %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode); + /* get device extension */ DeviceExtension = (PMOUHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension; @@ -750,6 +752,7 @@ MouHid_Pnp( /* get current irp stack */ IoStack = IoGetCurrentIrpStackLocation(Irp); + DPRINT1("[MOUHID] IRP_MJ_PNP Request: %x\n", IoStack->MinorFunction); if (IoStack->MinorFunction == IRP_MN_STOP_DEVICE || IoStack->MinorFunction == IRP_MN_CANCEL_REMOVE_DEVICE || IoStack->MinorFunction == IRP_MN_QUERY_STOP_DEVICE || IoStack->MinorFunction == IRP_MN_CANCEL_STOP_DEVICE) { @@ -896,7 +899,6 @@ MouHid_Unload( IN PDRIVER_OBJECT DriverObject) { UNIMPLEMENTED - ASSERT(FALSE); }