libretro / libretro/RetroArch

Linux/Wayland-Native - Multi mouse support

Open
#16,886 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug: wayland
Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Description

On Linux in a native Wayland session (simply running retroarch) with any input plugin (so udev or wayland), RetroArch does not seem able to support multiple mice - furthermore, trying to use any pointer device (whether it be absolute positioning lightgun or normal relative mouse) will not move the point of aim/aiming reticle in lightgun games.

To work around this, running RetroArch in XWayland is needed - in my case, using WAYLAND_DISPLAY="" retroarch forces RA to run in XWayland, and I can have access to a fully functioning udev input driver with multiple mice support.

Mouse Devices list under native Wayland (either udev or wayland input driver):
2024_08-16 124704

Mouse Devices list under XWayland with udev input driver:
2024_08-16 124815

In both examples, a Logitech G502 mouse and an OpenFIRE Lightgun are plugged into the PC, running under a user in the input group.

Expected behavior

At minimum, the ability to use a mouse device in lightgun games on a native Wayland RetroArch session; ideally, udev or wayland input driver should have feature parity with udev driver under X11 with the ability to address and use individual pointer devices for multiplayer.

Actual behavior

No mouse input is allowed in cores in either udev or wayland input drivers on native Wayland RetroArch.

Steps to reproduce the bug
  1. Input driver should be set to udev
  2. Run RetroArch in native a Wayland session (retroarch)
  3. Go to Settings->Input->RetroPad Binds->Port 1 Controls->Mouse Index
  4. Observe there only being a "Default" index, with all 15 other slots being "N/A"
  5. Launch a game in a core that supports Lightguns, e.g. MAME (Current)
  6. Observe how mouse button inputs are being recognized, and the cursor remains exactly in wherever the default position is regardless of mouse input.
  7. Exit, and relaunch RetroArch under XWayland (WAYLAND_DISPLAY="" retroarch)
  8. Repeat step 2
  9. Observe the Mouse Index being populated by multiple devices (if plugged in) with real names.
  10. Repeat step 4
  11. Observe how the in game aiming reticle is affected by input, depending on the mouse index setting.
Bisect Results

N/A (has this always been an issue?)

Version/Commit
  • RetroArch: 1.19.1 13dbb31f
Environment information
  • OS: Arch Linux
  • DE: KDE Plasma 6.1.4
  • WM: Kwin-wayland
  • GPU: NVIDIA GeForce RTX 3060ti

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with RetroArch's udev and wayland input-driver paths and the Settings → Input → RetroPad Binds → Port 1 Controls → Mouse Index behavior described here. Reproduce under native Wayland and XWayland, then verify that mouse devices are listed individually and that a selected device moves the aiming reticle in a lightgun-capable core such as MAME (Current).

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.