[vfio-users] qemu input and proper device recognition

Gerd Hoffmann kraxel at redhat.com
Fri May 13 08:41:23 UTC 2016


On Fr, 2016-05-13 at 04:40 +0200, thibaut noah wrote:
> Hi guys !
> I have a little question here about qemu inputs.
> It recognize the keyboard properly but not the mouse.
> I have a razer naga hex, a gaming mouse with lots of buttons, some of
> them are recognize either as keys 1  to 6 (on keyboard) or as 1 to 6
> keys on numpad.
> It seems qemu input fails to pass theses buttons to the guest thus
> making those mouse buttons useless.
> 
> 
> Does someone happen to know a workaround for this?
> Maybe adding another device?

Possibly.  In case the mouse presents itself as multifunction usb device
it'll show up with multiple devices on the host.  Maybe there is a
separate keyboard device for 1-6 kbd-style keys.

> Or is it directly related with how qemu deals with thoses devices?

That is a limitation too.  There are two fundamental options:  We can
either assign the device to the guest, or we can have qemu handle it and
forward input events.  The former (aka usb-host) has the advantage that
the guest has full control over the device.  The later (aka input-linux)
has the advantage that qemu will actually see the events and it is
possible to react on hotkeys to switch the device between guest and
host.  But the guest wouldn't see the real device then, events are sent
using emulated ps/2 kbd+mouse (or whatever emulated devices you have
configured).  And of course we can't send button events for buttons not
present on a ps/2 mouse.

> I could pass my mouse as a usb device but that would defeat the
> purpose of using only one mouse on my system (i don't want to unplug
> it).

Yes, exactly ;)

> Also to note, the device is not recognize properly so i cannot use
> razer synapse on the windows guest system.

See above, that can't work with input-linux as the guest doesn't see the
device in the first place.

cheers,
  Gerd






More information about the vfio-users mailing list