Direct Input axis format

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Hypersonic
Posts: 265
Joined: Mon Jul 12, 2010 5:58 pm

Re: Direct Input axis format

Post by Hypersonic »

In that case I think I'll install Unity, lots of cool games using it.

DI data from old Space Navigator (firmware 4.04)
Identifier 0463beef (046d vendor, beef product) hmm, maybe it's high in protein!
Device type FirstPerson (HID's multi-axis)
Axis count 7 (where's the 7th?)
Button count 4 (where are the other 2?)
Hat count 1 (huh?)

DI data from new Space Navigator (firmware 4.20)
Identifier c626046d (046d vendor, c626 product)
Device type FirstPerson
Axis count 6
Button count 2
Hat count 0

You should talk to Matt Toschlog (I have his email), on this thread he talks about using Rewired for controller support
(Matt was one of the co-creators of the very 1st 6DOF game, Descent)
https://playoverload.com/forums/topic/j ... -overload/
In the XML file I use for Space Navigator and Space Explorer I set transport as KMJ, so I'm thinking they're using Direct Input as well as Rewired.

I had the wrong product id in the XML for the Space Pilot Pro, I'm pretty sure that it will now work in Overload and other games (I had it working before.)

I'll be sure to send you an email via the form, it'll be great to have all the 3DMice models supported in Rewired.
Augie
Posts: 18
Joined: Wed Oct 22, 2014 2:04 pm

Re: Direct Input axis format

Post by Augie »

Hypersonic wrote: Fri Jun 29, 2018 6:59 amDI data from old Space Navigator (firmware 4.04)
Identifier 0463beef (046d vendor, beef product) hmm, maybe it's high in protein!
Device type FirstPerson (HID's multi-axis)
Axis count 7 (where's the 7th?)
Button count 4 (where are the other 2?)
Hat count 1 (huh?)
Haha! Bring on the baked potato. The "beef" product id is actually pretty common to see for some reason.
Hypersonic wrote: Fri Jun 29, 2018 6:59 amDI data from new Space Navigator (firmware 4.20)
Identifier c626046d (046d vendor, c626 product)
Device type FirstPerson
Axis count 6
Button count 2
Hat count 0
This looks like the one I just added support for.

Did you test Space Pilot Pro and Space Explorer? The email I sent you has instructions on what I'd need to see to support all these.
Hypersonic wrote: Fri Jun 29, 2018 6:59 amYou should talk to Matt Toschlog (I have his email), on this thread he talks about using Rewired for controller support (Matt was one of the co-creators of the very 1st 6DOF game, Descent)
Yeah, I've been in touch with him for a while. I added a number of things to Rewired for Overload for them.
Hypersonic wrote: Fri Jun 29, 2018 6:59 amIn the XML file I use for Space Navigator and Space Explorer I set transport as KMJ, so I'm thinking they're using Direct Input as well as Rewired.

I had the wrong product id in the XML for the Space Pilot Pro, I'm pretty sure that it will now work in Overload and other games (I had it working before.)
Okay, that makes sense. I haven't figured out how the KMJ emulator works yet. I see it detected as a device, but it doesn't produce any input values. I didn't look into how to use it yet. I see you use an XML file to configure it based on what you're saying. That's a distinct possibility Overload just supports it through the KMJ. I can also make a definition for the KMJ, but if the axis indices aren't fixed for the various directions, it wouldn't work very well since the user could remap it underneath and Rewired wouldn't know which axis is which. Unfortunately, I cannot get a Product Name from the KMJ device in Raw Input. HidD_GetProductString always fails when called on the device. Direct Input is able to get the product string, but not Raw Input.
Hypersonic
Posts: 265
Joined: Mon Jul 12, 2010 5:58 pm

Re: Direct Input axis format

Post by Hypersonic »

Lots of words you can make with hex alpha digits
https://github.com/tmk/tmk_keyboard/issues/150
dead beef cafe feed
I supppose it's used mostly for prototypes?

I did test the other 2 3DMice, I'll be sure to email you the results.

There are at least 3 transport protocols to choose from in the XML files: S80, MWM, and KMJ
-I think S80 is an older protocol, not sure.
-MWM is 3DX's native protocol for apps that use the SDK.
-KMJ (keyboard mouse joystick) uses the OS's common interface protocol for keyboard mouse joystick. Apps access this via Direct Input.

As you probably already know you can grab USB HID data directly without drivers loaded, which explains the SpaceNavigator entry. I don't have any drivers for my 4 axis joystick, for example, but it still works in many games.

The driver basically creates virtual devices, itself I assume reading values from USB HID. That's why you can't read raw data from it, it's not itself a USB device. Sometimes the SpaceNavigator and KMJ conflict, like in the Everspace bind menu, sometimes it binds to KMJ driver, sometimes to SpaceNavigator. (this could be a problem if the KMJ alters the scale, for example.)

What's nice about the KMJ driver is that it allows the user to tweak the data before it's sent to the game. Games don't always allow one to finesse the control input. Plus you can do some fancy things like use a 3DMouse to send keyboard keys, or have 3DMouse axis output 2Dmouse axis instead of joystick axis. With Direct Input v3 I could only bind 5 axis (6th was treated as a slider due to funny di3 <-> di5+ mapping) so in the game I bound a mouse axis to roll and had roll on the 3DMouse output that mouse axis. (In Descent rebirth, and my 6DOF quake mod.)

Since 3DX dropped it's profile exhange forum, I've created a group on Steam containing forums with instructions on how to configure the 3DMouse for various games. Many of the ones working with 3DMice also have VR, so it's time for me to get a VR HMD!
Augie
Posts: 18
Joined: Wed Oct 22, 2014 2:04 pm

Re: Direct Input axis format

Post by Augie »

Hypersonic wrote: Fri Jun 29, 2018 12:42 pm Lots of words you can make with hex alpha digits
https://github.com/tmk/tmk_keyboard/issues/150
dead beef cafe feed
LOL! I like that name for a restaurant: Dead Beef Cafe. And their tag line is "FEED!"
Hypersonic wrote: Fri Jun 29, 2018 12:42 pmI did test the other 2 3DMice, I'll be sure to email you the results.
Thanks!
Hypersonic wrote: Fri Jun 29, 2018 12:42 pmThere are at least 3 transport protocols to choose from in the XML files: S80, MWM, and KMJ
-I think S80 is an older protocol, not sure.
-MWM is 3DX's native protocol for apps that use the SDK.
-KMJ (keyboard mouse joystick) uses the OS's common interface protocol for keyboard mouse joystick. Apps access this via Direct Input.
This is interesting and useful. Thanks for sending me the XML files. That got me started in the right direction. The repository for all information for these XML files is C:\Program Files\3Dconnexion\3DxWare\3DxWinCore64\Cfg for anyone else wondering. You can find examples in there for everything. Look at Base.xml first.
Hypersonic wrote: Fri Jun 29, 2018 12:42 pmThe driver basically creates virtual devices, itself I assume reading values from USB HID. That's why you can't read raw data from it, it's not itself a USB device. Sometimes the SpaceNavigator and KMJ conflict, like in the Everspace bind menu, sometimes it binds to KMJ driver, sometimes to SpaceNavigator. (this could be a problem if the KMJ alters the scale, for example.)
Well, you can read data from it (blank), but the driver obviously won't send any data if it doesn't have an XML file for the exe to know what kind of data you want. As far as software is concerned, real and virtual devices are the same. All they see is the HID device created by whatever driver is being used.
Hypersonic wrote: Fri Jun 29, 2018 12:42 pmWhat's nice about the KMJ driver is that it allows the user to tweak the data before it's sent to the game. Games don't always allow one to finesse the control input. Plus you can do some fancy things like use a 3DMouse to send keyboard keys, or have 3DMouse axis output 2Dmouse axis instead of joystick axis. With Direct Input v3 I could only bind 5 axis (6th was treated as a slider due to funny di3 <-> di5+ mapping) so in the game I bound a mouse axis to roll and had roll on the 3DMouse output that mouse axis. (In Descent rebirth, and my 6DOF quake mod.)
Those are some very powerful features, to be sure. Since the KJM HID device seems to have a fixed number of axes and buttons at fixed HID usages, I can add direct support for the KJM device also. It supports the 6DOF axes, 1 throttle, 4 buttons, and 1 hat.
Hypersonic wrote: Fri Jun 29, 2018 12:42 pmSince 3DX dropped it's profile exhange forum, I've created a group on Steam containing forums with instructions on how to configure the 3DMouse for various games. Many of the ones working with 3DMice also have VR, so it's time for me to get a VR HMD!
That sounds very helpful. Thanks for helping the Steam community! :D

I had to buy a Rift last year due to some reported conflict with Rewired (turned out to be user error), but my video card is too old to run it. D'oh! Someday when the GPU prices get back to earth... But I'll probably wait for next gen Nvidia.
Hypersonic
Posts: 265
Joined: Mon Jul 12, 2010 5:58 pm

Re: Direct Input axis format

Post by Hypersonic »

I believe there is a hierarchy for XML files with the ones in %appdata% executed last, so they can override any xml files before them. They can even augment. For example Google Earth, it uses the one in %programfiles%, and if you want a slight change it'll put the slight change XML in %appdata% For example in mine I just changed <OverallScale>3</OverallScale>. A cool thing about the XML files in %appdata% is that it executes every time you save a change.

I believe the ones in %programdata% are for all users on the computer, and you already discovered the ones in %programfiles%.

Some XML files seem to be generic (I think global is one), they automatically run for any program if there is no user generated XML file for it. That's why often times pitch scrolls in many apps.

There's still much for me to learn though, it's been a few years since I've dealt with 3DMouse XML files and there's been alot of changes since then.
Jwick and Ngomes developed the driver so they could tell you more about it.

Ya I think that's everything the joystick portion of the KMJ has. You can use an absolute axis of a 3DMouse to control the virtual slider in KMJ driver, I've used it once for an airplane throttle.

I suppose it could have included even more joystick states
https://docs.microsoft.com/en-us/previo ... 7(v=vs.85)
https://docs.microsoft.com/en-us/previo ... v%3dvs.85)

It would be cool if the KMJ driver would expand its repertoire and output stuff like pedal and wheel axis as well, for example, for even more game support. Back on the y axis could be brake, forward could be the accelerator pedal.

I already have almost a dozen 6DOF games working well with 3DMice. I plan to start adding a bunch of 4 and 5 DOF games soon. Using Nvidia Shadowplay I plan to make a bunch of 4K 60fps videos of the smooth gameplay 3DMice provide and link them into the forum threads.

Speaking of VR, I'd like to get a swivel chair with a desk that swivels with it for VR, put mice and keyboard on it, then perhaps buy a Vive Pro.
Augie
Posts: 18
Joined: Wed Oct 22, 2014 2:04 pm

Re: Direct Input axis format

Post by Augie »

Hypersonic wrote: Sat Jun 30, 2018 3:57 pm I believe there is a hierarchy for XML files with the ones in %appdata% executed last, so they can override any xml files before them. They can even augment. For example Google Earth, it uses the one in %programfiles%, and if you want a slight change it'll put the slight change XML in %appdata% For example in mine I just changed <OverallScale>3</OverallScale>. A cool thing about the XML files in %appdata% is that it executes every time you save a change.

I believe the ones in %programdata% are for all users on the computer, and you already discovered the ones in %programfiles%.

Some XML files seem to be generic (I think global is one), they automatically run for any program if there is no user generated XML file for it. That's why often times pitch scrolls in many apps.

There's still much for me to learn though, it's been a few years since I've dealt with 3DMouse XML files and there's been alot of changes since then.
Jwick and Ngomes developed the driver so they could tell you more about it.
Thanks! all this information is very useful!
Hypersonic wrote: Sat Jun 30, 2018 3:57 pmYa I think that's everything the joystick portion of the KMJ has. You can use an absolute axis of a 3DMouse to control the virtual slider in KMJ driver, I've used it once for an airplane throttle.
I've added support for the throttle axis on the KMJ driver definition in Rewired..
Hypersonic wrote: Sat Jun 30, 2018 3:57 pmIt would be cool if the KMJ driver would expand its repertoire and output stuff like pedal and wheel axis as well, for example, for even more game support. Back on the y axis could be brake, forward could be the accelerator pedal.
I haven't run into any device that actually uses the accelerator or brake HID usages (except on Android). All the modern and even very old racing wheels map the accelerator/brake/clutch to one of the standard HID axes like Y, Z, RotXYZ.
Hypersonic wrote: Sat Jun 30, 2018 3:57 pmI already have almost a dozen 6DOF games working well with 3DMice. I plan to start adding a bunch of 4 and 5 DOF games soon. Using Nvidia Shadowplay I plan to make a bunch of 4K 60fps videos of the smooth gameplay 3DMice provide and link them into the forum threads.
Awesome! This will be helpful for a lot of gamers out there I'm sure.
Post Reply