Some Compatibility Issues

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Some Compatibility Issues

Post by 3D User »

Hi, I'm having some difficulty with my SpaceMouse Compact. I apologize that this post is so long, but I tend to be thorough, just to make sure that I provide all relevant details, just in case they're needed.

First of all, the device works great in general, meaning that I'm able to test it with the programs that are included with it, and I'm very happy with how accurate and smooth the movement is.

But I'm experiencing problems when I use it in alternative ways, which theoretically should work correctly. I intend to use it for a wide variety of purposes, including not only 3D modeling/viewing but also cross-platform programming and games, on various operating systems (well, specifically Windows and Linux).

There are essentially three problems:

- When running it in Windows 10, I can't get it to work very well as a game controller, or I guess more accurately, as something emulating a DirectInput device.

- I can't get it to run in Linux Mint 20, or I have no way of really testing it for that, so I'm not sure whether it works.

- Some of the settings and buttons don't quite do what I want.

The first problem is the most important one for me to fix at the moment, though I'd like for it to also work in Linux (but I'm not even sure that it doesn't), but I'll address these issues in reverse order, just to get the easy ones out of the way first (at least easy for me to explain, anyway).


Settings/Buttons:

There are two buttons on the device (though Windows has a profiler for when I emulate a DirectInput device, which reports it as having four buttons and an extra "throttle" axis for some reason, but I have no idea why - what's that about?), and when I press either button it displays four options in a ring formation. This is fine for some contexts, but I'd like to be able to make them act as regular buttons, programmable to do whatever I want, whenever necessary. Also, I may need to tweak the axes or reverse them, or swap them, etc. This stuff seems to be possible at least to some extent within the configurations/settings tool (sorry, I don't remember what this stuff is called because I'm currently in Linux so I can't see it), but I read somewhere in the manual that it only applies to the sample programs like the model viewer. So I'm not sure how to customize this stuff in general, even for emulating a DirectInput controller (even when they act as two arbitrary buttons it seems to still show the two menus), and also, when I tilt it forward and backward it seems to act like I'm rolling the wheel on a mouse forward and backward, even if it emulates DirectInput, as though it's acting as both simultaneously, and this really gets in the way when I don't want it to do that.


Linux Mint:

Actually, I typed this whole thing ahead of time and then later realized that Linux has a separate forum, so I moved this to there instead, but if you have any advice about it then please check my other topic. Thanks.


DirectInput Emulation:

And now for the big problem - it only partially works for emulating a DirectInput controller. I followed the method of making a copy of the JoystickTemplate.xml file (I think that's what It's called) for each game and setting the tags for the name and .exe name to match each game (it's just the file name, rather than the whole path, right?), and when I do that, it *sometimes* makes the game detect the device, and other times it doesn't, or it may detect some axes but not all of them.

Also, sometimes it causes one axis to think that it's pushed all the way to one side even when it's not, so that the view will just keep panning or spinning rapidly. I've had this problem before if I had multiple devices plugged in which were incompatible with each other, but I've tried the SpaceMouse by itself, with all other devices unplugged (I even restarted Windows with it that way), and I still got this problem. I could try changing the minimum and maximum values for those axes in the .xml file, but I haven't tried that yet. Should they only be a positive range, or is it alright for them to be negative? The minimum is negative by default and I don't know if that's causing an incompatibility, or maybe the range is too great of one game expects a range of 0 - 255.

Sometimes this also gets in the way of setting controls, because it thinks that I'm always pushing one axis. I've tried switching which physical axis maps to which logical axis (if you want to call it that) by altering the tags in the .xml files in ways that seem like they would have that effect, but it didn't seem to have any effect at all.

There are exceptions to these problems though; for example, Overload works flawlessly for all 6 axes (though the two buttons still show menus), but really the only game that works the way that it's supposed to (out of the couple dozen or so that I've tested). But the Descent games don't work correctly, and I know for a fact that they've been traditionally considered compatible with these types of 6 DOF devices. It's possible that Overload was designed to specifically use the 3Dconnexion API, but I have no way of knowing that, because it doesn't indicate that in the settings.

The really weird thing is that I made one copy of the .xml file to correspond to a .dll for the DirectInput testing tool, and it works great there! For some reason it shows it as having four buttons and seven axes (one is called "throttle") and a directional pad, so it seems to think that there's more on it than there is (it only has two buttons), but other than that it seems to be able to detect the motion of everything just fine.

So I know for a fact that it's able to correctly emulate DirectInput; shouldn't that theoretically mean that ANY program which is compatible with DirectInput should be able to use the device just fine?

By the way, is there any compatibility with XInput? I know that it doesn't quite have enough axes, but one axis could be split so that each half would act as one of the analog triggers, and then with the four axes in the two analog sticks, that would leave just one additional axis, which I guess could emulate two buttons or directions on the pad, so it seems like it could theoretically work pretty well, though I don't know any information about it actually being compatible. And if it isn't then is there a way that I could make it so? I'm a programmer, so I'm not afraid to write some code if necessary.

Again, I apologize for such a long post, but I figure that it's better to provide too many details than too few, and then have you try to guess what I'm talking about.
3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Re: Some Compatibility Issues

Post by 3D User »

Actually, now that I think about it, Overload didn't recognize it until I made a .xml file for it, so it must be using DirectInput also, which proves that it's possible for it to work, and that it should theoretically work for any program which is compatible with DirectInput. So that's only more puzzling why it doesn't work.
jwick
Moderator
Moderator
Posts: 3350
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Some Compatibility Issues

Post by jwick »

The two buttons on the SpaceMouse Compact are assigned to Radial Menus ("rings") in our default files. You can assign them to something else (or nothing) in our GUI (while the game is in focus). This will write a game-specific cfg file for you, but it sounds like you already have those.

The buttons (and axes) may very well be interpreted by the game separately. The data can go to more than one place simultaneously. You will need to tell the driver that the game uses DirectInput to keep the buttons from being interpreted twice. <Transport>DirectInput</Transport>

The main issue you are running into is variations in DirectInput support. The 3D mouse is DirectInput compatible, but only some games will interpret it correctly.
By using the JoystickTemplate, you are telling the driver to output Joystick data, not raw device data. This may very well be required for most games. They probably support a joystick not a 3D mouse. Our joystick emulator advertises a number of buttons and axes, and a throttle. The game will see those without knowing exactly what device is attached.

Your solution is unfortunately going to be game-specific. It will depend on what the game expects, which Microsoft API it uses. Truly impressive games will interpret the device, natively, correctly (rare). Most will need the joystick emulator. And then, you will probably need to modify the game parameters to correctly interpret the data coming from our emulator (e.g., relative vs absolute axes). I'd leave the device output alone, to eliminate the number of moving parts.

Try them in this order, for each game:
1) Native support (HID or Raw Input)
2) DirectInput, as a 3D mouse
3) DirectInput, as a joystick
4) Keyboard emulation (won't be terribly satisfactory)

On Linux, there is no emulation. The O/S may forward the data with the native input API.
3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Re: Some Compatibility Issues

Post by 3D User »

Thanks for the clarification! But are you implying that I should use some method/file other than JoystickTemplate.xml, and if so then what? Or for that matter, how do I do your steps 1 through 4 in terms of implementing them into any sort of configuration (xml?) files?

The main problem may be that there doesn't seem to be a manual for how to do these things, or if there is then I haven't seen one. The only reason why I even know about the JoystickTemplate.xml file was because I saw it mentioned on this forum, but I've had to look in there and experiment with it intuitively to try to figure out what to do. Does there happen to be any sort of manual or guide for these things?

I also read something that implied that there used to be software that could set this up, like a profiling tool or something. Where can I get that?

And I'm not even sure what the native input API is in Linux (I'm sort of new to Linux).
3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Re: Some Compatibility Issues

Post by 3D User »

Also, I checked the <transport> tag (which I didn't even know existed until you mentioned it - thanks), and it says "KMJ", but I'm not exactly sure what KMJ is or what the alternative to that would be, though I'll try replacing it with "DirectInput" the next time I'm in Windows.
jwick
Moderator
Moderator
Posts: 3350
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Some Compatibility Issues

Post by jwick »

Transport has 4 interesting values for native APIs:

<Transport>KMJ</Transport>
<Transport>RawInput</Transport>
<Transport>DirectInput</Transport>
<Transport>HID</Transport>

You can only have one per file.

KMJ tells the driver you will be redirecting output to some HIDJoystick_* function.
RawInput tells the driver the app will be reading Raw Input events. It prevents the driver from sending the events on its own and changes the way the driver handles filtering.
DirectInput similarly tells the driver the app will be getting events directly from the system API.
HID also tells the driver to not forward the events itself.

The latter three still allow you to adjust scaling, filtering, etc using the GUI. This is done slightly differently for each API, thus why it is important to specify it.

In general, the native APIs work completely on their own. The driver has nothing to do with reading the device and getting the data to the application. The applications don't even need kb focus to get data -- it's a separate path. The specification of the Transport in the driver is mostly to just tell it how to get out of the way. The native APIs don't need the driver to be installed to function.

The general scheme just relies on the Input/Output specifications per Axis.
For the last three Transports, leave the Axes alone (in fact you don't need to specify them--the defaults are fine).
If you want the driver to send Joystick (Mouse, Keyboard) events (KMJ), change the Output/ActionID to HIDJoystick_* (as seen in that JoystickTemplate.xml file).

For
1) make a file with <Transport>HID</Transport>. If that doesn't work, try <Transport>RawInput</Transport>. Don't specify any Axis elements.
2) make a file with <Transport>DirectInput</Transport>. No Axis elements.
3) in the file with <Transport>DirectInput</Transport>, change the Axis/Output/ActionIDs to the ones in JoystickTemplate (HIDJoystick_X/Y/Z/etc)
4) make a copy of the KeyboardTemplate.xml or KeyboardWASDTemplate.xml (add the Executable etc).

What does "if it works" mean? You should get movement when moving the cap. And you should be able to make modifications that get to the app. E.g., swap some axes, change scalefactors. This indicates that the app is actually reading the data the driver is sending. In most cases, you will need to use the game's internal control panel to mold the data to the game's expectations. Some games give you every control you need. Many don't. In fact, many games just grab the first joystick-type device they see and ignore all the others. When they do that, our emulator can be grabbed and a real joystick will stop working.

Yes, there was a program for doing all this for you. Unfortunately, it is no longer available. Notepad++, with XML extensions, is your friend.

Linux used to have an X Input Extension. I think there is something newer. Support for it is very spotty between all the different Linux flavors. I wouldn't set very high expectations for Linux. There are occasionally some public domain contributors that make something work for a while...
3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Re: Some Compatibility Issues

Post by 3D User »

Well thanks for all of the info! I'll try all of those things.

When you say "The general scheme" are you referring specifically to the "KMJ"? What does that acronym mean, by the way?

I don't remember saying the words "if it works", and I searched and couldn't find them, so if you're implying that I said that then I don't know what the context was.
3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Re: Some Compatibility Issues

Post by 3D User »

Also, why isn't that program available anymore? There's got to be some way that I can get it. What's the name of it? I'll see if I can find it.
jwick
Moderator
Moderator
Posts: 3350
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Some Compatibility Issues

Post by jwick »

KMJ = Keyboard, Mouse, Joystick (emulator)

The cfg editing program is now out-of-date. I haven't kept it up-to-date with the latest cfg format changes.

I wrote "if it works". Meaning, how you test whether the changes you are making are being used.

Hint: turn on logging (3Dx systray icon -> Write Log File) and use baretail on the log file to watch what is happening. The log file (%localappdata%\3dconnexion\3Dxware\3DxService.log) tells you a lot about what cfg files are being chosen and what axes are being sent). It's very verbose. You can PM copies of it to me to diagnose what is happening.
3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Re: Some Compatibility Issues

Post by 3D User »

Thanks for the info. So I guess even if I did somehow get the program it wouldn't work, because it's not compatible with how the file format is currently storing information? Oh well.

If by "%localappdata%" you mean "c://Users/[user name]/AppData/local", which is where it seems to be, then in that case I've found the directory to which you refer, but inside of it that file isn't there. There are several similarly named files though: 3dxnlserver.log, 3DxService.bak (which is 0 bytes), 3DxServiceState.xml, but no 3DxService.log.

By the way, how does it detect when a program runs just by the name of the .exe file specified, and how does it launch an emulation of a device to attach to it like it does? I've been planning to write my own driver for something else, but I've never written a driver before, and I've always wondered how profilers are able to connect things in that way.
jwick
Moderator
Moderator
Posts: 3350
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Some Compatibility Issues

Post by jwick »

You can type %localappdata% into explorer to go to the right place.

If you have no log file in there, it isn't turned on. Right click on the 3Dx systray icon to turn it on (Write Log File).

The simplest way it finds out which cfg to use is to use the ExecutableName. In the cfg file you create for that app, you tell the driver what type of events it needs to send. It's rather difficult for it to figure that out on its own.
3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Re: Some Compatibility Issues

Post by 3D User »

Well thanks a lot. I'll keep all of this in mind the next time I'm in Windows and have some time to work on it (which will probably be tomorrow). I'm excited that it will hopefully work (keeping my fingers crossed, which makes it a bit hard to do some things, but oh well), and I'll report back with the results in case anything is awry. But you've developed some great interface for a truly amazing input device!
3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Re: Some Compatibility Issues

Post by 3D User »

Well I tested Crime Cities the way that you suggested. I must have tried it 30 times, and nothing seems to work right, but here's what I did:

First I tried making a copy of the JoystickTemplate.xml file, changing the <Name> tags (there are two for some reason - one inside <CfgProperties> and one inside <AppInfo> and <Signature> but I changed both, and by the way, do I also need to change the ID tag?), and properly setting the <ExecutableName> tag to the file name for the game.

To test your methods, I first set <Transport> to HID, and removed all of the <Axis> tags from inside of <AxisBank>, but kept the <AxisBank> tag with the <ID> and <Name> tags within it. Is that the correct way to do it? I kept the second <Device> tag unchanged (I'm not sure why there are two). When I played the game with this file it caused me to spin uncontrollably as soon as I began to nudge the device, but it was affected by my input at all times after that, but kept spinning at various speeds and also moving some.

Did you say about a velocity axis earlier? I can't find it for some reason, so maybe it was something I read elsewhere, but suspect that it may be treating it that way, and I don't know how to change it from that to a regular positional axis, and I worry that it may be constantly accellerating every time I press it (though it seemed to accellerate to full velocity very quickly when I only tapped it gently, even though I have the axis sensitivity turned down to a reasonable level within the game options).

I next tried changing the file only by setting the <Transport> tag to RawInput, and then replaced the file in the Cfg folder (I don't think I should have two simultaneously that both reference to the same program), but it had exactly the same effect.

Then I changed <Transport> to DirectInput and tried again, and once again it had the same effect. The contents of this file are displayed below.

After that I tried re-copying the JoystickTemplate.xml file and changing the <Name> and <ExecutableName> tags and setting the <Transport> tag to DirectInput but leaving everything else unchanged so that the <Axis> tags are still there, as shown farther below, under the contents of the other file, but that gave me exactly the same result as well.

I also tried changing that same file to set the minimum values to 0 instead of -511, thinking that maybe it doesn't like negative numbers, but I still got the same result.

Then I tried copying the KeyboardTemplate.xml file and changing the <Name> and <ExecutableName> tags, and again got the exact same result, which I wouldn't have expected from keyboard emulation.

This was all done with only the SpaceMouse Compact plugged in and the XBox controller unplugged, so it couldn't have been confusing the SpaceMouse for that.

I've tried other games and gotten the same kind of results as this, with the fast, uncontrollable spinning. Since they all can use game controllers (and DirectInput ones, or at least not exclusively XInput ones, because most of the games are relatively old, but some new ones as well), theoretically at least one of these modes should work for each game. But I've tried literally dozens of games with this device and only a single one of them (Overload) works well at all! The rest either have this same spinning problem or they simply don't read the device at all!

As for other relevant information:

The Windows testing/calibration tool has inexplicably exchanged a lot of the axes and inverted the horizontal tilting, even though I never told it to do any of that. I even noticed that they're different when I play Overload as well - I had to change them in the options, and the numbers that it assigns to the axes no longer match what they were before, so I don't know why it suddenly decided to reassign everything.

In a lot of games/programs (including Windows itself) it always activates/emulates the mouse wheel when I tilt forward or backward even though the <IgnoreMouseWheelInertia> tag is set to false. Why's that?

I managed to create the log file (thanks for the info, btw), and it mentions Crime Cities numerous times, so I know that it's loading in the .xml file and using it, but I can't really display the whole file here because it's huge (even though it has only existed for about an hour).

Also, it seems like ever since I installed this device and started messing with these files, Windows has been taking like at least half an hour to boot, which was never a problem before that (it used to boot in a minute or two), but I don't know whether that's related or a coincidence, but I have no idea what else it could be. Then when I tried to restart, it said that it was having trouble shutting down a program called USB something-or-other, which temporarilly prevented it from restarting.



Anyway, here's the first file, with all of the <Axis> tabs stripped out of it, by the time that I set the <Transport> tag to DirectInput (but I tried it before that with HID and RawInput, but the file was otherwise identical to this):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
(c) Copyright 3Dconnexion. All rights reserved.
$Revision: 17739 $
-->
<AppCfgTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Default="true" CfgFormatVersion="1.3" ThisFileVersion="1.7">
<CfgProperties>
<ID>ID_STR_3_JOYSTICK_TEMPLATE</ID>
<Name>Crime Cities</Name>
<InheritsFromID>ID_Default_Cfg</InheritsFromID>
</CfgProperties>
<AppInfo>
<Signature>
<Name>Crime Cities</Name>
<ExecutableName>CRIMECITIES.EXE</ExecutableName>
<Transport>DirectInput</Transport>
</Signature>
<Options>
<IgnoreMouseWheelInertia>true</IgnoreMouseWheelInertia>
</Options>
</AppInfo>
<AuthorInfo>
<DriverVersion>17.6.1</DriverVersion>
<Created>
<Tool>3DxService.exe</Tool>
<Version>17.5.5</Version>
<Date>2017:11:2:28:10:58:11:745</Date>
<User>3DxCfgAdmin</User>
</Created>
<LastChange>
<Tool>XMLCfgEditor.exe</Tool>
<Version>17.6.1</Version>
<Date>6/27/2019 10:04:51 AM UTC</Date>
<User>jwick</User>
</LastChange>
</AuthorInfo>
<Settings>
<ResponseCurve>1.00</ResponseCurve>
</Settings>
<ButtonActions>
<!-- App Handled Actions -->
<ButtonAction Type="App" xsi:type="ButtonAction_App">
<ID>App_ResetYourView</ID>
<Name>STR_APP_RESETYOURVIEW</Name>
</ButtonAction>
<!-- Keyboard Functions -->
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_1</ID>
<Name>STR_JOYSTICK_1</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_2</ID>
<Name>STR_JOYSTICK_2</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_3</ID>
<Name>STR_JOYSTICK_3</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_4</ID>
<Name>STR_JOYSTICK_4</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_Hat_N</ID>
<Name>STR_JOYSTICK_HAT_N</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_Hat_E</ID>
<Name>STR_JOYSTICK_HAT_E</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_Hat_S</ID>
<Name>STR_JOYSTICK_HAT_S</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_Hat_W</ID>
<Name>STR_JOYSTICK_HAT_W</Name>
</ButtonAction>
</ButtonActions>
<Devices>
<Device>
<ID>ID_Standard_3D_Mouse</ID>
<Name>Standard 3D Mouse</Name>
<AxisFilter>None</AxisFilter>
<CurrentAxisBank>Default</CurrentAxisBank>
<CurrentButtonBank>Default</CurrentButtonBank>
<AxisBank Default="true">
<ID>Default</ID>
<Name>STR_DEFAULT_BANK</Name>
</AxisBank>
<ButtonBank Default="true">
<ID>Default</ID>
<Name>STR_DEFAULT_BUTTONBANK</Name>
<InheritsFromID/>
<Button>
<Input>
<ActionID>V3DK_MENU</ActionID>
</Input>
<Output>
<ActionID>Driver_ShowDriverGUI</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_FIT</ActionID>
</Input>
<Output>
<ActionID>Driver_ShowDriverGUI</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_TOP</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_Hat_N</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_LEFT</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_Hat_W</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_RIGHT</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_Hat_E</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_FRONT</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_Hat_S</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_1</ActionID>
</Input>
<Output>
<ActionID>Driver_Toggle_3DxNumPad</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_2</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_2</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_3</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_3</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_4</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_4</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_ESC</ActionID>
</Input>
<Output>
<ActionID>KB_Esc</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_ALT</ActionID>
</Input>
<Output>
<ActionID>KB_Alt</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_SHIFT</ActionID>
</Input>
<Output>
<ActionID>KB_Shift</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_CTRL</ActionID>
</Input>
<Output>
<ActionID>KB_Ctrl</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_ROTATE</ActionID>
</Input>
<Output>
<ActionID>Driver_ToggleTranslations</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_DOMINANT</ActionID>
</Input>
<Output>
<ActionID>Driver_ToggleDominantFilter</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_PLUS</ActionID>
</Input>
<Output>
<ActionID>Driver_IncreaseAppScale</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_MINUS</ActionID>
</Input>
<Output>
<ActionID>Driver_DecreaseAppScale</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_USER</ActionID>
</Input>
<Output>
<ActionID>Driver_ToggleRotations</ActionID>
</Output>
</Button>
</ButtonBank>
</Device>
<Device>
<ID>ID_ProductID_C62E</ID>
<Name>SpaceMouse Wireless</Name>
<CurrentAxisBank>Default</CurrentAxisBank>
<CurrentButtonBank>Default</CurrentButtonBank>
<ButtonBank Default="true">
<ID>Default</ID>
<Name>STR_DEFAULT_BUTTONBANK</Name>
<InheritsFromID/>
<Button>
<Input>
<ActionID>HIDButton_1</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_1</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>HIDButton_2</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_2</ActionID>
</Output>
</Button>
</ButtonBank>
</Device>
</Devices>
</AppCfgTemplate>



And here's the file for when I tried it with DirectInput, but without removing the <Axis> tags (it's bascially just the JoystickTemplate.xml file with a couple of tags tweaked). This is the one that I also tried after changing the -511 values to 0:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
(c) Copyright 3Dconnexion. All rights reserved.
$Revision: 17739 $
-->
<AppCfgTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Default="true" CfgFormatVersion="1.3" ThisFileVersion="1.7">
<CfgProperties>
<ID>ID_STR_3_JOYSTICK_TEMPLATE</ID>
<Name>Crime Cities</Name>
<InheritsFromID>ID_Default_Cfg</InheritsFromID>
</CfgProperties>
<AppInfo>
<Signature>
<Name>Crime Cities</Name>
<ExecutableName>CRIMECITIES.EXE</ExecutableName>
<Transport>DirectInput</Transport>
</Signature>
<Options>
<IgnoreMouseWheelInertia>true</IgnoreMouseWheelInertia>
</Options>
</AppInfo>
<AuthorInfo>
<DriverVersion>17.6.1</DriverVersion>
<Created>
<Tool>3DxService.exe</Tool>
<Version>17.5.5</Version>
<Date>2017:11:2:28:10:58:11:745</Date>
<User>3DxCfgAdmin</User>
</Created>
<LastChange>
<Tool>XMLCfgEditor.exe</Tool>
<Version>17.6.1</Version>
<Date>6/27/2019 10:04:51 AM UTC</Date>
<User>jwick</User>
</LastChange>
</AuthorInfo>
<Settings>
<ResponseCurve>1.00</ResponseCurve>
</Settings>
<ButtonActions>
<!-- App Handled Actions -->
<ButtonAction Type="App" xsi:type="ButtonAction_App">
<ID>App_ResetYourView</ID>
<Name>STR_APP_RESETYOURVIEW</Name>
</ButtonAction>
<!-- Keyboard Functions -->
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_1</ID>
<Name>STR_JOYSTICK_1</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_2</ID>
<Name>STR_JOYSTICK_2</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_3</ID>
<Name>STR_JOYSTICK_3</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_4</ID>
<Name>STR_JOYSTICK_4</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_Hat_N</ID>
<Name>STR_JOYSTICK_HAT_N</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_Hat_E</ID>
<Name>STR_JOYSTICK_HAT_E</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_Hat_S</ID>
<Name>STR_JOYSTICK_HAT_S</Name>
</ButtonAction>
<ButtonAction Type="Joystick" xsi:type="ButtonAction_Joystick">
<ID>HIDJoystick_Hat_W</ID>
<Name>STR_JOYSTICK_HAT_W</Name>
</ButtonAction>
</ButtonActions>
<Devices>
<Device>
<ID>ID_Standard_3D_Mouse</ID>
<Name>Standard 3D Mouse</Name>
<AxisFilter>None</AxisFilter>
<CurrentAxisBank>Default</CurrentAxisBank>
<CurrentButtonBank>Default</CurrentButtonBank>
<AxisBank Default="true">
<ID>Default</ID>
<Name>STR_DEFAULT_BANK</Name>
<Axis>
<Enabled>true</Enabled>
<Input>
<ActionID>HIDMultiAxis_X</ActionID>
<Min>-512</Min>
<Max>511</Max>
</Input>
<Output>
<ActionID>HIDJoystick_X</ActionID>
</Output>
</Axis>
<Axis>
<Enabled>true</Enabled>
<Input>
<ActionID>HIDMultiAxis_Y</ActionID>
<Min>-512</Min>
<Max>511</Max>
</Input>
<Output>
<ActionID>HIDJoystick_Y</ActionID>
</Output>
</Axis>
<Axis>
<Enabled>true</Enabled>
<Input>
<ActionID>HIDMultiAxis_Z</ActionID>
<Min>-512</Min>
<Max>511</Max>
</Input>
<Output>
<ActionID>HIDJoystick_Z</ActionID>
</Output>
</Axis>
<Axis>
<Enabled>true</Enabled>
<Input>
<ActionID>HIDMultiAxis_Rx</ActionID>
<Min>-512</Min>
<Max>511</Max>
</Input>
<Output>
<ActionID>HIDJoystick_Rx</ActionID>
</Output>
</Axis>
<Axis>
<Enabled>true</Enabled>
<Input>
<ActionID>HIDMultiAxis_Ry</ActionID>
<Min>-512</Min>
<Max>511</Max>
</Input>
<Output>
<ActionID>HIDJoystick_Ry</ActionID>
</Output>
</Axis>
<Axis>
<Enabled>true</Enabled>
<Input>
<ActionID>HIDMultiAxis_Rz</ActionID>
<Min>-512</Min>
<Max>511</Max>
</Input>
<Output>
<ActionID>HIDJoystick_Rz</ActionID>
</Output>
</Axis>
</AxisBank>
<ButtonBank Default="true">
<ID>Default</ID>
<Name>STR_DEFAULT_BUTTONBANK</Name>
<InheritsFromID/>
<Button>
<Input>
<ActionID>V3DK_MENU</ActionID>
</Input>
<Output>
<ActionID>Driver_ShowDriverGUI</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_FIT</ActionID>
</Input>
<Output>
<ActionID>Driver_ShowDriverGUI</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_TOP</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_Hat_N</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_LEFT</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_Hat_W</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_RIGHT</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_Hat_E</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_FRONT</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_Hat_S</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_1</ActionID>
</Input>
<Output>
<ActionID>Driver_Toggle_3DxNumPad</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_2</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_2</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_3</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_3</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_4</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_4</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_ESC</ActionID>
</Input>
<Output>
<ActionID>KB_Esc</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_ALT</ActionID>
</Input>
<Output>
<ActionID>KB_Alt</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_SHIFT</ActionID>
</Input>
<Output>
<ActionID>KB_Shift</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_CTRL</ActionID>
</Input>
<Output>
<ActionID>KB_Ctrl</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_ROTATE</ActionID>
</Input>
<Output>
<ActionID>Driver_ToggleTranslations</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_DOMINANT</ActionID>
</Input>
<Output>
<ActionID>Driver_ToggleDominantFilter</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_PLUS</ActionID>
</Input>
<Output>
<ActionID>Driver_IncreaseAppScale</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_MINUS</ActionID>
</Input>
<Output>
<ActionID>Driver_DecreaseAppScale</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>V3DK_USER</ActionID>
</Input>
<Output>
<ActionID>Driver_ToggleRotations</ActionID>
</Output>
</Button>
</ButtonBank>
</Device>
<Device>
<ID>ID_ProductID_C62E</ID>
<Name>SpaceMouse Wireless</Name>
<CurrentAxisBank>Default</CurrentAxisBank>
<CurrentButtonBank>Default</CurrentButtonBank>
<ButtonBank Default="true">
<ID>Default</ID>
<Name>STR_DEFAULT_BUTTONBANK</Name>
<InheritsFromID/>
<Button>
<Input>
<ActionID>HIDButton_1</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_1</ActionID>
</Output>
</Button>
<Button>
<Input>
<ActionID>HIDButton_2</ActionID>
</Input>
<Output>
<ActionID>HIDJoystick_2</ActionID>
</Output>
</Button>
</ButtonBank>
</Device>
</Devices>
</AppCfgTemplate>
jwick
Moderator
Moderator
Posts: 3350
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Some Compatibility Issues

Post by jwick »

That file does nothing. It is an AppCfgTemplate, not an AppCfg file. It is (was) used as a template (starting point) for creating cfgs for games. It by itself isn't used.

Let's start over.
Uninstall 3DxWare. This takes all our software out of the picture so we can test what the game is doing.
Start the game with no other devices attached. See if it recognizes the 3D mouse.

If it does, and it doesn't work correctly (moves continuously, doesn't stop when you release the cap), the game is using one of the native APIs to read the device but is misinterpreting the axes. This is a game software shortcoming.

The game may have an internal control panel that lists the input devices it has recognized and allows you to set some parameters for them.
Some games make this easy. Some have it hidden. Some don't provide for this. You may have to ask the game dev or on a game forum.

Joystick devices, historically don't have negative values. They have a range from 0-max, and the game interprets max/2 as zero (at rest). The 3D mouse has a +/- 511-ish range. With 0 being zero (at rest). The device describes itself to the system. The system makes this description available to the game, but many game developers don't make use of it. They only make the game work with the device sitting on their desk, invariably a 0-max flightstick or gamepad, and move on to the next task. Admittedly, to do this correctly, is a lot of work for them.

If it doesn't recognize the device, install 3DxWare, which will install our KMJ emulator. Which implements a 0-max joystick.

In the GUI, while the game is running, turn off all the axes except one (e.g., X - pan left/right). This will create a valid cfg for you that is valid for the game, but will still be using the native device description. Test that axis in the game. Report your results.

The next step will be to change that cfg file to use the KMJ emulator. I'll walk you through that after you report your results.
3D User
Posts: 18
Joined: Fri Dec 10, 2021 7:10 am

Re: Some Compatibility Issues

Post by 3D User »

Thanks, I'll try all of this, but I'm a bit confused about a few things that you said:

- Which file does nothing, the copy of the JoystickTemplate.xml file that I make for a game and change the <Name> and <ExecutableName> tags, etc.? Those are all the files that I've been working on, and I know that they do something, because without creating them the games never read the device at all. Or do you mean a different file?

- I'll uninstall it, but as I recall (and I may be misremembering), the software installed with the driver automatically, so wouldn't that uninstall the driver as well? Or if not then is there a different way to reinstall the software later without reinstalling the driver that's already there, or would that even conflict with it, or just overwrite it?

- I've noticed about all game controllers usually ranging from 0 to 255 (like they store it in a byte or something), and I've actually done a lot of programming for DirectInput, so I know that you can just query the device for the min and max numbers, and then scale the range to that. It's never been difficult for me at all. But I suppose if a game doesn't bother to do this then it wouldn't work, hence the reason why I tried changing the -511 to 0, hoping that it would cause the scaling to happen before it even gets sent to the game, but somehow that didn't work.

- You say that if it doesn't recognize the device without KMJ and I reinstall it (which I expect will be the case, because games never seem to be written to natively support a 3D mouse, though I don't know why not), and then disable all extra axes then it will automatically create a new cfg - by that do you mean a new .xml file? I thought I had to create that manually, or am I misunderstanding you, and you just mean a new configuration file within the game itself?

- In any case, does that mean that I'd have to go through this process of uninstalling and reinstalling the software/driver/whatever for each game that I want to test? What if some work without it and some work with it, then do I have to uninstall/reinstall it whenever I switch from one to another?

Well I'm going to go test all of the stuff that you've told me now, but these questions are really perplexing me at the moment.
Post Reply