Mouse can't work on VBox

Ask your support questions in here

Moderator: Moderator Team

Post Reply
hzlilx
Posts: 25
Joined: Sun Feb 13, 2011 1:06 pm

Mouse can't work on VBox

Post by hzlilx »

My computer is ASUS i7 notebook pc, I test the newest trunk version on qemu and vbox, qemu seems to work well, but vbox, the mouse can't work. I find the reason is that ros can't get mouse position correct, on the file reactos\reactos\win32ss\user\ntuser\mouse.c, line 189/190 show me ptCursor.x/ptCursor.y is too big to fit the desktop size.

It seems reactos\reactos\lib\drivers\hidparser\api.c has a mistake, line 637/638,

Code: Select all

Parser->Copy(&Data, &ReportDescriptor[ReportItem->ByteOffset +1], min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1)));
Data = ReportDescriptor[ReportItem->ByteOffset + 1];
the second line seems redundancy and mistake, I delete the second line, but it still not work.

Just for test, I change file reactos\reactos\win32ss\user\ntuser\mouse.c, line 183-204,

Code: Select all

    if (pmi->dwFlags & MOUSEEVENTF_MOVE)
    {
        /* Mouse has changes position */
        if (!(pmi->dwFlags & MOUSEEVENTF_ABSOLUTE))
        {
            /* Relative move */
            ptCursor.x += pmi->dx;
            ptCursor.y += pmi->dy;
        }
        else if (pmi->dwFlags & MOUSEEVENTF_VIRTUALDESK)
        {
            /* Absolute move in virtual screen units */
            ptCursor.x = pmi->dx * UserGetSystemMetrics(SM_CXVIRTUALSCREEN) >> 16;
            ptCursor.y = pmi->dy * UserGetSystemMetrics(SM_CYVIRTUALSCREEN) >> 16;
        }
        else
        {
            /* Absolute move in primary monitor units */
            ptCursor.x = pmi->dx * UserGetSystemMetrics(SM_CXSCREEN) >> 16;
            ptCursor.y = pmi->dy * UserGetSystemMetrics(SM_CYSCREEN) >> 16;
        }
    }
to
ptCursor.x = pmi->dx * UserGetSystemMetrics(SM_CXVIRTUALSCREEN) >> 15;
ptCursor.y = pmi->dy * UserGetSystemMetrics(SM_CYVIRTUALSCREEN) >> 15;
this time the mouse point shows and goes correct, the mouse position gets and shows right, but it still don't response left click or right click.

Maybe, when use vbox, the pmi->dwFlags don't set right correctly. Can somebody do a right fix for this problem?
Last edited by Saibamen on Sun Aug 05, 2012 6:24 pm, edited 3 times in total.
Reason: BBCode fix

hzlilx
Posts: 25
Joined: Sun Feb 13, 2011 1:06 pm

Re: Mouse can't work on VBox

Post by hzlilx »

Further information, mouse can't work correctly on VBox only for HidUsb mouse driver, on this condition, you can delete hidclass.sys/hidparse.sys/hidsub.sys from livecd.iso, which is in subdirectory reactos\system32\driver, to let mouse work on legacy mouse driver, and it will run well.

SomeGuy
Posts: 586
Joined: Mon Nov 29, 2004 9:48 am
Location: Marietta, GA

Re: Mouse can't work on VBox

Post by SomeGuy »

Awesome job pulling the code apart.

Would you please submit this as a bug in Bugzilla?

hzlilx
Posts: 25
Joined: Sun Feb 13, 2011 1:06 pm

Re: Mouse can't work on VBox

Post by hzlilx »

Bug 7227 reported, please check.

Now I surprise to find, after I modified the two files(reactos\reactos\lib\drivers\hidparser\api.c, reactos\reactos\win32ss\user\ntuser\mouse.c), I can also respond mouse left click and right click. I remember mouse left click and right click couldn't work yesterday even I changed that two files.

Pisarz
Posts: 375
Joined: Sat May 12, 2007 9:29 am

Re: Mouse can't work on VBox

Post by Pisarz »

Just disable USB mouse emulation in VBox and it should work actually.

hzlilx
Posts: 25
Joined: Sun Feb 13, 2011 1:06 pm

Re: Mouse can't work on VBox

Post by hzlilx »

Pisarz wrote:Just disable USB mouse emulation in VBox and it should work actually.
Thank you, but maybe somebody can fix this problem.

milon
Posts: 969
Joined: Sat Sep 05, 2009 9:26 pm

Re: Mouse can't work on VBox

Post by milon »

hzlilx wrote:bug 7227 reported, please check.
I'm no expert, but that looks like a solid bug report. And since you've supplied the solution, I expect a quick fix (unless there's other underlying stuff, like you alluded to with the left/right click issue).

hzlilx
Posts: 25
Joined: Sun Feb 13, 2011 1:06 pm

Re: Mouse can't work on VBox

Post by hzlilx »

I burned the livecd in a cdrw-disk, then test it in real hardware. The good news is, the livecd can work, it boot to destop success. The bad news is, the mouse can't work, no matter that changed or not changed that two files.

It need more time to find what cause the matter.

hzlilx
Posts: 25
Joined: Sun Feb 13, 2011 1:06 pm

Re: Mouse can't work on VBox

Post by hzlilx »

It seems the ROS can't find my HID mouse at all, therefore, it certanly can't act on mouse moving.

I use "device manager" under windows xp to see the connection of device tree, it shows:
ACPI Multiprocessor PC, ROOT\ACPI_HAL\0000
Microsoft ACPI-compliant System, ACPI_HAL\PNP0C08\0
PCI Bus, ACPI\PNP0A08\0
Intel(R) 5 Series/3400 Series Chipset...USB Enhanced Host Controller, PCI\VEN_8086&DEV_3B34&SUBSYS_1F371043&REV_06\3&11583659&0&E8
USB Root Hub, USB\ROOT_HUB20\4&21C21A30&0
Generic USB Hub, USB\VID_8087&PID_0020\5&875CD47&0&1
USB Human input device, USB\VID_046D&PID_C058\6&3A252BA0&0&3
HID-compliant mouse, HID\VID_046D&PID_C058\7&1DD8DEA&0&0000


but, ROS give me the information:
ROOT\PCI_HAL\0
PCI_HAL\PNP0A03\0
...
PCI\VEN_8086&DEV_3B34&SUBSYS_1F371043&REV_06\xxxxxxxxxxxxxxxx
USB\ROOT_HUB20\3&753df853
USB\VID_8087&PID_0020\xxxxxxxxxxxxxxx
[END!].
so it can't find the hid mouse device!

Can somebody tell me what cause this different?
Last edited by Saibamen on Thu Aug 16, 2012 4:58 pm, edited 1 time in total.
Reason: BBCode fix

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests