ManyMouse fix.

This commit is contained in:
Scott Duensing 2026-09-13 01:40:19 -05:00
parent 263409a743
commit c3b82d2627
2 changed files with 20 additions and 2 deletions

View file

@ -986,6 +986,15 @@ API Changes
Fixes Fixes
----- -----
- A machine with no enumerable mouse keeps its pointer. ManyMouse reads
/dev/input/event* directly where there is no X server, and those nodes
are root:input, so an account that was never added to the "input" group
enumerated nothing -- and Singe then switched off all mouse input,
including SDL's own pointer, which single-mouse mode is the only user
of. On a KMSDRM cabinet or handheld that left the mouse and the light
gun dead with only "No mice detected" to explain it. Only --manymouse
needs those devices now, and the message names the group.
- A lone .m2v played with --framefile now finds the .ogg beside it, as a - A lone .m2v played with --framefile now finds the .ogg beside it, as a
framefile's segments always have. A Daphne era elementary stream framefile's segments always have. A Daphne era elementary stream
carries no audio of its own, so lair.m2v played silently unless it was carries no audio of its own, so lair.m2v played silently unless it was

View file

@ -15567,9 +15567,18 @@ void singe(SDL_Window *window, SDL_Renderer *renderer, SDL_GPUDevice *device, Co
if (_global.mouseCount > MAX_MICE) { if (_global.mouseCount > MAX_MICE) {
_global.mouseCount = MAX_MICE; _global.mouseCount = MAX_MICE;
} }
// ManyMouse enumerates /dev/input itself, which needs membership of the "input" group; SDL's
// own pointer needs nothing. Only many-mouse mode reads ManyMouse's events -- the poll in the
// event loop discards them in single-mouse mode -- so enumerating nothing must not cost a
// machine its pointer, or Singe has no mouse at all on a stock Debian or Ubuntu install, in a
// container, or under any account that was never added to that group.
if ((_global.mouseCount < 1) && _global.mouseEnabled) { if ((_global.mouseCount < 1) && _global.mouseEnabled) {
utilSay("Warning: No mice detected. Mouse input disabled."); if (_global.conf->manyMouse) {
_global.mouseEnabled = false; utilSay("Warning: No mice detected. Mouse input disabled.");
_global.mouseEnabled = false;
} else {
utilSay("Warning: No mice could be enumerated; using the system pointer. Light guns and --manymouse need this user in the \"input\" group.");
}
} }
for (x = 0; x < _global.mouseCount; x++) { for (x = 0; x < _global.mouseCount; x++) {
strncpy(_global.mice[x].name, ManyMouse_DeviceName((unsigned)x), sizeof(_global.mice[x].name) - 1); strncpy(_global.mice[x].name, ManyMouse_DeviceName((unsigned)x), sizeof(_global.mice[x].name) - 1);