libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.25k stars 1.83k forks source link

[Feature Request] x11 input driver multi-mouse support #15702

Open Codes4Fun opened 1 year ago

Codes4Fun commented 1 year ago

Description

X11 has support for multiple mice, configurable by users, and udev has permission issues on some linux distros, this seems like a better solution in those cases

Expected behavior

Retroarch is able to use/track multiple mice in x11.

Actual behavior

Retroarch only follows one mouse. For example in the opera core, both blue/red cursors follow the first mouse.

Steps for creating multiple mice under linux x11

  1. hook up a second mouse/touchpad to a linux/x11 computer.
  2. use xinput create-master mouse2 to create a second virtual mouse called mouse2.
  3. use xinput to display ids, and attach second mouse id to mouse2 id via xinput reattach 9 18 replacing 9 with second mouse id and 18 with mouse2 virtual mouse id.

Notes for retroarch changes to the x11 input driver to support reading a second mouse

Basically retroarch would use XIQueryPointer instead of XQueryPointer to read a second mouse. I experimentally hacked the code with hard coded ids and it does work but it needs to be figured out how to get the virtual mouse ids, and x11_input.c would needs to add support for storing multiple mouse states to pass on to the core.

I plan to research this further and post more information here, and unless an official dev/contributor takes this on, I will eventually try to create a patch for this.

gouchi commented 2 months ago

Similar issue for Wayland input driver.