I was told to copy the 3D mouse template. I have no idea which template that is. There isn’t one named 3D Mouse… So, I am playing with the 3DxSDKTemplate.xml and JoystickTemplate.xml files. As best I can deduce the same changes are needed in either file.
Copy the file JoystickTemplate.xml to the folder:
Rename it to SecondLifeViewer.xml or whatever viewer name you want to use with it. This name is for you. You can make as many profiles as you use viewers. But, only one per viewer.
You need to look in the viewer’s install folder for the viewer’s main file. You’ll need that file’s name in the next steps. If you have an icon on your Desktop or pinned to your Task Bar right-click it, select properties, and look on the Shortcut tab for the program’s name. Two examples:
- Firestorm 64: Firestorm-bin.exe
- SL Viewer: SecondLifeViewer.exe
I suggest a filename like: Firestorm-bin.xml or SecondLifeViewer.xml.
Now open the file and find the line starting with: <AppCfgTemplate Default=”true”
Change it to read: <AppCfg Default=”false”… I’ve omitted the remainder of the line.
Now, jump to the end of the file and change </AppCfgTemplate> to </AppCfg>. Then go back the beginning of the file.
A line or two down find and change the <Name> tag to read: <Name>Second Life</Name>
Change <ExecutableName> to read: <ExecutableName>SecondLifeViewer.exe</ExecutableName> or change it for other viewers, e.g., <ExecutableName>Firestorm-bin.exe</ExecutableName>. Remember. Get the name of your viewer’s executable as described above. This name must be an exact match. I don’t know whether capitalization matters, so I assume it does.
The value <InheritsFrom> can be changed to: <InheritsFrom />. There is a space after the ‘m’.
I am not sure about this InheritsFrom one. So, I’m just guessing for this entry. I tried different values as I experimented. This one worked.
Next change the Transport type. Legal types are:
- KMJ (Keyboard, Mouse, Joystick emulation)
- HID (HID API from Microsoft)
- RawInput (Microsoft Raw Input API)
- DirectInput (the Microsoft DirectInput API)
- S80 (current 3DxWare SDK API)
- MWM (ancient 3Dconnexion API)
Find the line with <Transport> and change the value to read: <Transport>DirectInput</Transport>
So far all these changes have been made in the <Settings> section of the file.
Next I think we need to add our changes for how we want things to work. Look through the file for <Devices>. Make sure these next changes are made in the part of this file for your device. The SpaceNavigator comes in several different versions. Find the section for your version. In my case it is SpaceNavigator.
In that section find <ActionID>HIDButton_1</ActionID>. In the following <Output> section change <ActionID>HIDJoystick_1</ActionID> or whatever is there to <ActionID>Driver_ShowDriverGUI</ActionID>. This will set the left-SN-button to open the SN configuration panel.
The right-hand button is <ActionID>HIDButton_2</ActionID>. This is the one I want to program. Leave it alone for now. Test the changes made so far and then continue on.
Save these changes. This updates the file in the \Roaming\… folder. Theoretically we should be able to go into Services and restart the 3Dconnexion driver service and have things update. In my experience so far, that only works sometimes. So, I reboot now.
When the computer is up open your viewer. See if the SpaceNavigator is working. If so, press the left-SN-button. You should get the configuration panel that looks very much like the first image in this article except with the name Second Life. If not, you did something wrong. I’ve posted my changes to the file below.
My Settings section of the file looks like:
<AppCfg Default="false" xmlns="" CfgFormatVersion="1.1" ThisFileVersion="1.0"> <AppInfo> <Name>Second Life</Name> <VersionRange> <Min>126.96.36.199</Min> <Max>188.8.131.52</Max> </VersionRange> <ExecutableName>SecondLifeViewer.exe</ExecutableName> <InheritsFrom /> <ApplicationIcon>3Dx.ico</ApplicationIcon> <Transport>DirectInput</Transport> </AppInfo> <Settings> <ResponseCurve>1.00</ResponseCurve> </Settings>
My device section of the file has this in it:
<ButtonBank Default="true"> <Name>STR_DEFAULT_BUTTONBANK</Name> <ID>Default</ID> <Button> <Input> <ActionID>HIDButton_1</ActionID> </Input> <Output> <ActionID>Driver_ShowDriverGUI</ActionID> </Output> </Button>
This is all that needs to change. With these changes the SN will recognize the profile and open the configuration panel. You can then use that to program the right-SN-button, which is way easier then manually building a macro.
If you cannot get your profile to work, read the SN log. It will give you clues as to what is wrong.
Read the log file in: %appdata%/3dconnexion/3dxware/3dxservice.log
Someone always wants to do more. In my digging I came across more information than I ultimately did not need. But, if you start to write custom macros, you will want to know this stuff.
Buttons & Keys
To program the buttons we have to deal with Microsoft’s idea of how to create a Human Input Device. They use integers to number buttons and keys and then reference them by those numbers. We have to understand those numbers. If you run into that challenge you can find the list of them here: USB HID usage table.
What can we program?
There is no published manual for working with the profile files in SN. This post will be the most comprehensive document I’ll have seen in all my searching. But, you can signup as a developer at the 3Dconnexion site and get a SDK. I assume it has manuals and explains more.
The keywords you can use in the XML profiles are all contained in files installed with SN. Look in:
Find the file base.xml. If a keyword is in this file then SN knows what to do with it. We just have to figure it out. The file base.xml is said by 3DConnexions to be the master list of words.
Global_def.xml is the master settings for the SN. The values placed in it affect all the profiles. Add settings in your profile to override these values, otherwise they are used.
See the SN file en-US_def.xml. This is where all the keys and buttons are defined. If they are not defined here, you can’t use them. The file is with the other XML files in the Cfg folder.
SL Viewer Values
These are listed as the Debug Settings label, its description, default value and whether it is persistent or not.
- AutoLeveling – Preferences: Auto Level – Keep Flycam level. – True – Persistent
- FlycamAbsolute – Treat Flycam values as absolute positions (not deltas). – False – “
- FlycamAxisDeadZone0 – 6 – ? – 0.1 – “
- FlycamAxisScale0 – 6 – ? – 0.1 – “
- FlycamBuildModeScale – Scale factor to apply to flycam movements when in build mode. – 1.0 – “
- FlycamFeathering – Flycam feathering (less is softer – Feathering = smoothing and easing) – 16.0 – “
- FlycamZoomDirect – Map flycam zoom axis directly to camera zoom. – False – “
- JoystickAvatarEnabled – JoystickAvatarEnabled – True – “
- JoystickAxis0-6 – Flycam hardware axis mapping for internal axis 0-6 ([0, 5]). – 1 – “
- JoystickBuildEnabled – Enables the Joystick to move edited objects. – False – “
- JoystickEnabled – Enables Joystick Input. – False – “
- JoystickFlycamEnabled – Enables the Joystick to control the flycam. – True – Not Persistent
- JoystickInitialized – Whether or not a joystick has been detected and initialized. – T/F Read Only
- JoystickMouselookYaw – Pass joystick yaw to scripts in Mouselook. – True
- JoystickRunThreshold – Input threshold to initiate running – 0.25 – Persistent
- Alt+Shift ⇧+F – Flycam on/off