Description
Hi,
I have a problem to properly configure my setup to use multiple "mice".
Hardware input devices
- 1 real USB mouse
- 1 Ultimarc SpinTrack spinner connected via USB (using Ultimarc's USB adapter)
- another SpinTrack connected via USB using Ultimarc's I-PAC 2.
In total 3 "mouse"
System
Fujitsu desktop PC.
Debian 10 buster
Running Xorg, with minimalistic Openbox window manager.
MAME 0228, compiled "by hand".
Build defines 1: SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1
Build defines 1: LSB_FIRST=1 PTR64=1
SDL/OpenGL defines: SDL_COMPILEDVERSION=2009 USE_OPENGL=1
Compiler defines A: __GNUC__=8 __GNUC_MINOR__=3 __GNUC_PATCHLEVEL__=0 __VERSION__="8.3.0"
Compiler defines B: __amd64__=1 __x86_64__=1 __unix__=1
Compiler defines C: __USE_FORTIFY_LEVEL=0
I figured out udev. I was able to set the 0666 umask to all relevant devices, and I was able to create symlinks to the different spinners (though I don't think they're used anywhere).
I think I figured out Xorg and libinput, and I am able to attach and detach the different devices to the "Virtual core pointer" master device, so when I twist the spinners I can see the mouse move, or I can choose to not do so. I am also able to create new distinct master devices and attach the spinners to those instead of the main Virtual core pointer. When I do so, new mouse pointers appear on the screen, but then, strangely, they don't behave correctly, i.e. they don't move when I rotate the spinner, but only jump to 2 or 3 fixed positions on the screen. That I don't quite understand, but I like to think it's unrelated (?). I am also able to swap the X and Y coordinates of the spinners (with the command xinput set-prop <dev_id> "Coordinate Transformation Matrix" 0 1 0 1 0 0 0 0 1
), so I can map one of them to the X-axis and the other to the Y-axis, so even when both spinners are attached to the main Virtual core pointer master device, I can theoretically distinguish between them by axis. But, unfortunately, it looks like this configuration is disregarded by mame.
The problem is that inside MAME I always only see one "Mouse 1" device, no matter what I do. I don't quite understand the chain of libraries/technologies/components used by MAME to interact with the physical devices in my setup, so I'm a bit in the dark. It looks like it's somehow related to Xorg, because if I leave the spinner devices "floating" (i.e. not attached to the main Virtual core pointer master device) their movement is not detected in MAME. Indeed, here's what I see in the logs:
Input: Adding mouse #0: System mouse (device id: System mouse)
Mouse: Registered System mouse
Mouse: End initialization
I see no other seemingly mouse-related log lines.
So, if MAME (or, rather, SDL?) is able to figure out the main Virtual core pointer master device, why is it not able to detect other master devices if I create them?
Then I though, oh well, if I can't get multiple mice to be detected, I will merge them all inside the same main system pointer, but will swap the second spinner to operate on the Y axis, so I can see them as Mouse 1 X
and Mouse 1 Y
. But, unfortunately, I still see them both as Mouse 1 X
.
Maybe I'm compiling mame against the wrong library versions? Or maybe I'm missing a library entirely?
How can I even debug this thing?
Any advice would be greatly appreciated. I'm stuck at the moment, not able to use 2 spinners at the same time.
Thanks!