From: Ben G. on
Hi folks,

I'm developing a USB HID mouse device that works in absolute pointing mode.
When there are multiple monitors attached to the computer, the device is
aware of the topology and layout of the monitors, so it can scale the
coordinates to the bounding box of the monitors.

We have a PS/2 version of this device and a custom driver that always sets
the MOUSE_VIRTUAL_DESKTOP flag when queueing MOUSE_INPUT_DATA packets.

I'd like to be able to use the stock mouhid driver on systems with multiple
monitors, but as far as I can tell, mouhid never sets MOUSE_VIRTUAL_DESKTOP.
This limits the mouse cursor to the primary display.

Is there any way for a USB HID device to set a flag in its report descriptor
that will get mouhid to set MOUSE_VIRTUAL_DESKTOP in its MOUSE_INPUT_DATA
packets?

Thanks!


From: Ray Trent on
In the case of a USB device using the stock driver, how would you make
it so, as you say, "the device is aware of the topology and layout of
the monitors, so it can scale the coordinates to the bounding box of the
monitors"?

Seems like you're going to need a driver for that purpose anyway, so why
not use the same filter driver (that scales your coordinates) to
intercept the mouclass callbacks and set the flag?

To answer your question more directly, I know of no way to get mouhid to
do that for you.

Ben G. wrote:
> Hi folks,
>
> I'm developing a USB HID mouse device that works in absolute pointing mode.
> When there are multiple monitors attached to the computer, the device is
> aware of the topology and layout of the monitors, so it can scale the
> coordinates to the bounding box of the monitors.
>
> We have a PS/2 version of this device and a custom driver that always sets
> the MOUSE_VIRTUAL_DESKTOP flag when queueing MOUSE_INPUT_DATA packets.
>
> I'd like to be able to use the stock mouhid driver on systems with multiple
> monitors, but as far as I can tell, mouhid never sets MOUSE_VIRTUAL_DESKTOP.
> This limits the mouse cursor to the primary display.
>
> Is there any way for a USB HID device to set a flag in its report descriptor
> that will get mouhid to set MOUSE_VIRTUAL_DESKTOP in its MOUSE_INPUT_DATA
> packets?
>
> Thanks!
>
>


--
Ray
From: Ben G. on
Thanks for the super speedy reply, Ray!

"Ray Trent" wrote:

> In the case of a USB device using the stock driver, how would you make
> it so, as you say, "the device is aware of the topology and layout of
> the monitors, so it can scale the coordinates to the bounding box of the
> monitors"?

This is actually for a virtual USB mouse device running as part of a virtual
machine. The virtual USB device directly communicates with the display
subsystem of the virtual machine (no filter driver involved) to figure out
the topology of the monitors attached to Windows.

Due to the complexity of maintaining another custom kernel driver, as well
the expense and time of going through WHQL to get that driver signed for each
and every release of our software, it'd of course be much preferred if we
could get mouhid to set MOUSE_VIRTUAL_DESKTOP in its packets.

> To answer your question more directly, I know of no way to get mouhid to
> do that for you.

No problem. I appreciate you taking the time to answer my question!

From: Ray Trent on
Ben G. wrote:
> Thanks for the super speedy reply, Ray!

No problem.

What I meant, BTW, was that you could add code to your existing PS/2
driver to handle the USB case as well (you need to filter at the exact
same spot to do this on the USB side, and do pretty much the same thing).

I don't know exactly what you did in that PS/2 driver, but it's even
remotely possible that all you'd have to do is add an entry in the INF
file to filter USB too. But even if you have to write special code for
the USB side, there's no reason the same .sys file can't control both
kinds of device, even simultaneously (we do it all the time).

Then you'd only have 1 driver, with 1 WHQL requirement (though you could
split the INF into two separate ones if you really wanted to).
--
Ray
From: Doron Holan [MSFT] on
there is no interface to have mouhid set the virtual deskto flag. you can
easily write an upper filter between mouhid and mouclass which sets this
flag on every reported input packet though. as ray said, your ps2 driver
(if it is a filter) can play double duty on both stacks.

d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Ray Trent" <rat(a)nospam.nospam> wrote in message
news:e0x6xw$oIHA.420(a)TK2MSFTNGP02.phx.gbl...
> Ben G. wrote:
>> Thanks for the super speedy reply, Ray!
>
> No problem.
>
> What I meant, BTW, was that you could add code to your existing PS/2
> driver to handle the USB case as well (you need to filter at the exact
> same spot to do this on the USB side, and do pretty much the same thing).
>
> I don't know exactly what you did in that PS/2 driver, but it's even
> remotely possible that all you'd have to do is add an entry in the INF
> file to filter USB too. But even if you have to write special code for the
> USB side, there's no reason the same .sys file can't control both kinds of
> device, even simultaneously (we do it all the time).
>
> Then you'd only have 1 driver, with 1 WHQL requirement (though you could
> split the INF into two separate ones if you really wanted to).
> --
> Ray