Heya!
I'm looking for a solution on how to emulate a controller with two analog sticks with my SpaceMouse Pro.
I've tried a thirdparty tool like x360ce, but the way that it converts the axis values is not useful for me. Releasing the puck on the SpaceMouse doesn't make the axis values snap back to zero, instead it continuously increases/decreases them.
I'm aware of the WASD functionality that 3DConnexion provides via the .xml configs, but I'm in need of more sensitive input, which the analog sticks would provide.
You can tell the driver to output joystick events.
There is a <3DxWinCore>/Cfg/JoystickTemplate.xml that shows how to do this.
You have to do some XML editing.
1) Have the driver make a cfg for your application by making some change in our "3Dconnexion Properties" GUI.
2) This will make a file for your app in %appdata%\3Dconnexion\3DxWare\Cfg (you should recognize the name).
3) Replace the <ButtonActions> and <Devices> section in that file in %appdata% with the sections from the JoystickTemplate.xml file.
Movement and buttons on the SpaceMouse will now send joystick events to your app. You will probably need to use the UI of the app to configure the joystick event handling.
I suspect the software I'm using doesn't support "generic" joystics and requires an Xinput device.
Is there a way for me to force a specific profile XML profile? I'd like to perhaps try to pipe the input from the SpaceMouse into a third party app (like x360ce) that would convert the KMJ input into a suitable controller configuration? The problem is that every time I have an active app the driver loads a profile for that specific app.
Alternatively, is there a list somewhere from which I could look up the codes for keyboard keys? Currently these are not really "human readable" and lots of guess work has to be done to map everything out.
So far I've gathered that:
Q = 14
E = 08
S = 16
W = 1A
Once your cfg is loaded, the driver will not switch away from it.
The easiest way to get those HID keycodes is to use our GUI to create a kb macro. The correct value for your keyboard will be written into your cfg file. It is somewhat kb dependent. You can also google the HID Usage tables. That's where they come from.
There are some very nice third party kb/joystick mapping apps out there. I forget the names. They are very capable.
Hard grabbing did the trick! I'm now able to set up the 3DConnexion KMJ in x360ce and the profile will stay active!
Thank you jwick!
However, I'm having to do a slightly janky workaround when binding some of the controller buttons to the HIDMultiAxis_Z.
I'd like to do this, but it doesn't work:
A 3D mouse Axis -> Joystick Button? That's not implemented.
What do you want it to do?
Press the button above a value of 100? What about the negative direction?
Is it supposed to hold it until the value goes below 100? Or press, release, press, release, continuously while above 100?
I’d like to have pushing down on the puck to register as a joystick button press, and as I stop pushing down on the puck and it’s axis value returns to 0 stop the joystick button press.
Basically the same functionality as in the WASD template and how it handles those keyboard key presses, but instead with a joystick buttons.
The driver doesn't handle that. It does some of that for a 2D mouse event, but this is the first time I've heard of doing it for a joystick.
The joystick support is limited to acting like a typical system joystick.
The only way I can think of doing this, is to use the driver extension mechanism to call SendInput. I don't recall if that works for sending joystick events. You would need to write code for that. It's not trivial.