hamburglin wrote:Thanks for the response Bart.
What I'm looking to do is compile a simple executable that retrieves the mouses in the same exact manner that sm3 does. Once I have that list, I'll determine which hardware IDs my light guns are and update the sm3 config accordingly.
I didn't write the input code but I think it just receives a list of devices from DirectInput or SDL, in whatever order they provide, and enumerates them from 1 onwards. This may not be consistent, particularly, if you unplug devices or plug in new ones. You can pretty easily determine joystick numberings (and maybe mouse numberings, but I haven't checked) by typing: supermodel -print-inputs
For example, I get the following output in there:
- Code: Select all
Input System Settings
---------------------
Input System: Xinput
Keyboards:
System Keyboard
Mice:
System Mouse
Joysticks:
1: Xbox 360 Controller 1 (via XInput) [Force Feedback Available]
2: Pro Controller
I have two game pads plugged in. Note that I initially only had the "Pro Controller" (a Sega 6-button USB pad) plugged in and it was therefore assigned #1. When I plug in my XBox controller, it was assigned #1 and the earlier controller became #2. To my knowledge, this is not something you can rely on.
Otherwise and as far as mame, they allow you to use assign a hardware ID to "player/mouse 1" However, I don't know how that is handed off, mapped and then used exactly.
Supermodel doesn't know about hardware IDs. Someone would have to code that up. I will accept a comprehensive solution but will reject solutions that only work for e.g. DirectInput but not XInput, RawInput, or SDL modes (assuming this is possible in each mode). It needs to be a complete solution that works across all possible input system modes that Supermodel supports.
My question to you or any one familiar with the sm3 code base is: can you point me to the exact line in the source code that retrieves the mice and obtains/assigns their mouse index number?
I don't know off-hand where that specific code is but the general input system is in Inputs/. The specific input system code is located in OSD/SDL/SDLInputSystem.cpp (SDL), OSD/Windows/DirectInputSystem.cpp (DirectInput, XInput, and RawInput). You could also follow along from OSD/SDL/Main.cpp examining how the -print-inputs option works and trace into the code from there.