Home ยป Tech ยป Binding Shortcut Keys to 3Dconnexion Knob/Axis on SpaceNavigator

Binding Shortcut Keys to 3Dconnexion Knob/Axis on SpaceNavigator

We love these space mice, so much that we bought ourselves two circa 2010. They work well in CAD software, but sometimes we wished we could use them in other applications.

With a bit of scripting, we can, but we simply never bothered, hoping 3DConnexion would eventually release a driver that would do the job. It never came.

Our reason for looking into how to bind keys arose from our use of Presonus Studio One. We wanted to pan the screen left and right without using the mouse to click arrows or shift the slider. Additionally the keyboard shortcuts felt clunky.

The driver software we used was 3DxWare64_v10-7-0_r3248.exe and the 3Dconnexion Properties application creates xml profiles for every active application, storing them at:

C:\Users\<username>\AppData\Roaming\3Dconnexion\3DxWare\Cfg

Then it was a matter of deciphering the code syntax, as well as finding out the available command options. For that we navigated the 3Dconnexion forums and studied a few scripts.

By default, axis behaviour is defined within a set of <axis></axis> tags across the full range (-512 to 511) of that axis. To bind our custom key/shortcut to an axis, the full axis range is split into three ranges, e.g. lower (-512 to -200), middle (-199 to 199) and upper (200 to 511). The purpose being that the middle is the inactive range and the knob needs to be moved a certain degree before input registers – a means of setting the sensitivity.

The default ActionID (HIDMultiAxis) is changed to KB_Keystroke and the custom Key we desire is specified as a hexadecimal. It took us a while to find the reference document.

https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf

Pages 53, 54, 55 contain what we want. Here is an excerpt.

Open image in new tab – to enlarge to actual size

In the case of shortcuts that involve holding down Alt, Shift or Control, modifiers are added using tags (see example code below).

There are two parameters for adjusting the axis behaviour: Scale and MaxEventRate. The default for both is 1.00. We believe MaxEventRate is the fastest repeat rate of key press, while Scale is how quickly it tapers up to that maximum rate.

The Enabled (true/false) tags allow us to turn the axis on or off without having to delete the settings in the script.

Here is a sample of the xml code profile for Presonus. We added comment tags to improve the clarity. Note: when the GUI saves the file, it will alter the formatting of the comments into something much less legible.

<?xml version="1.0" encoding="utf-8"?>
<!--
(c) Copyright 3Dconnexion. All rights reserved. 
$Revision: 17343 $
-->
<AppCfg xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Default="false" CfgFormatVersion="1.3" ThisFileVersion="1.12">
  <AppInfo>
    <Signature>
      <Name>Studio One</Name>
      <ExecutableName>Studio One.exe</ExecutableName>
    </Signature>
    <Options />
  </AppInfo>
  <CfgProperties>
    <ID>ID_Studio One</ID>
    <Name>Studio One</Name>
    <InheritsFromID>ID_Default_KMJ_Cfg</InheritsFromID>
  </CfgProperties>
  <Devices>
    <Device>
      <ID>ID_Standard_3D_Mouse</ID>
      <AxisBank>
        <Name>Default</Name>
        <ID>Default</ID>
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_X</ActionID>            <!-- x axis -->
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_X</ActionID>
            <Reversed>false</Reversed>
          </Output>
        </Axis>
        <Axis>
          <Enabled>false</Enabled>
                         <!-- y axis disabled-->
          <Input>
            <ActionID>HIDMultiAxis_Y</ActionID>            <!-- y axis PUSH UP-->
            <Min>-512</Min>
            <Max>-100</Max>
          </Input>
          <Output>                                                 <!--                  -->
            <ActionID>KB_Keystroke</ActionID>                      <!-- keystroke    -->
            <Scale>1.00</Scale>                                    <!--  scale            -->
            <MaxEventRate>1.00</MaxEventRate>                      <!--  event rate            -->
            <Modifiers>                                            <!--              -->
              <Modifier></Modifier>                                <!--  modifier  options: Control, Shift, Alt, Windows, LeftMouse, MiddleMouse, RightMouse   -->
            </Modifiers>                                           <!--              -->
            <KeyStroke>                                            <!--  keystroke            -->
              <Key>08</Key>                                        <!--              -->
            </KeyStroke>                                           <!--              -->
          </Output>
        </Axis>
        <Axis>
          <Enabled>true</Enabled>

                          <!-- y axis enabled-->
          <Input>
            <ActionID>HIDMultiAxis_Y</ActionID>            <!-- y axis MID RANGE-->
            <Min>-99</Min>
            <Max>99</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Y</ActionID>
            <Reversed>false</Reversed>
          </Output>
        </Axis>        
        <Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Y</ActionID>            <!-- y axis PUSH DOWN-->
            <Min>100</Min>
            <Max>511</Max>
          </Input>
          <Output>                                                                                 <!--                  -->
            <ActionID>KB_Keystroke</ActionID>                                                      <!-- keystroke    -->
            <Scale>1.00</Scale>                                                                    <!--  scale            -->
            <MaxEventRate>1.00</MaxEventRate>                                                      <!--  event rate            -->
            <Modifiers>                                                                            <!--              -->
              <Modifier></Modifier>                                                                <!--  modifier  options: Control, Shift, Alt, Windows, LeftMouse, MiddleMouse, RightMouse   -->
            </Modifiers>                                                                           <!--              -->
            <KeyStroke>                                                                            <!--  keystroke            -->
              <Key>1a</Key>                                                                        <!--              -->
            </KeyStroke>
            <!--              -->
          </Output>
        </Axis>
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Z</ActionID>            <!-- z axis -->
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Z</ActionID>
            <Reversed>false</Reversed>
          </Output>
        </Axis>




        
        
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rx</ActionID>            <!-- rotate x axis MID -->
            <Min>-99</Min>
            <Max>99</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Rx</ActionID>
            <Reversed>false</Reversed>
          </Output>
        </Axis>
   
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>            <!-- rotate y axis ROCK LEFT -->
            <Min>-512</Min>
            <Max>-100</Max>
          </Input>
          <Output>                                                   <!--                  -->
            <ActionID>KB_Keystroke</ActionID>                        <!-- keystroke        -->
            <Scale>1.00</Scale>                                      <!--  scale           -->
            <MaxEventRate>95.00</MaxEventRate>                       <!--  event rate      -->
            <Modifiers>                                              <!--                  -->
              <Modifier>Control</Modifier>                           <!--  modifier  options: Control, Shift, Alt, Windows, LeftMouse, MiddleMouse, RightMouse   -->
            </Modifiers>                                             <!--                  -->
            <KeyStroke>                                              <!--  keystroke       -->
              <Key>50</Key>                                          <!--                  -->
            </KeyStroke>                                             <!--                  -->
          </Output>
        </Axis>
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>            <!-- rotate y axis MID -->
            <Min>-99</Min>
            <Max>99</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Ry</ActionID>
            <Reversed>false</Reversed>
          </Output>
        </Axis>
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>            <!-- rotate y axis ROCK RIGHT-->
            <Min>100</Min>
            <Max>511</Max>
          </Input>
          <Output>                                                    <!--                  -->
            <ActionID>KB_Keystroke</ActionID>                         <!-- keystroke        -->
            <Scale>1.00</Scale>                                       <!--  scale           -->
            <MaxEventRate>95.00</MaxEventRate>                        <!--  event rate      -->
            <Modifiers>                                               <!--                  -->
              <Modifier>Control</Modifier>                            <!--  modifier  options: Control, Shift, Alt, Windows, LeftMouse, MiddleMouse, RightMouse   -->
            </Modifiers>                                              <!--                  -->
            <KeyStroke>                                               <!--  keystroke       -->
              <Key>4f</Key>                                           <!--                  -->
            </KeyStroke>                                              <!--                  -->
          </Output>
        </Axis>
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID>                      <!-- rotate z axis -->
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Rz</ActionID>
            <Reversed>false</Reversed>
          </Output>
        </Axis>
      </AxisBank>
      <AxisFilter>None</AxisFilter>
    </Device>
  </Devices>
  <AuthorInfo>
    <DriverVersion>17.7.0.17687</DriverVersion>
    <LastChange>
      <Tool>3DxSmartUI.exe</Tool>
      <Version>1.2.20251.17614</Version>
      <Date>10/21/2020 12:07:20 PM UTC</Date>
      <User>office</User>
    </LastChange>
  </AuthorInfo>
  <MacroTable>
    <MacroEntry>
      <ID>W</ID>
      <KeyStroke>
        <Key>1A</Key>
      </KeyStroke>
    </MacroEntry>
    <MacroEntry>
      <ID>E</ID>
      <KeyStroke>
        <Key>8</Key>
      </KeyStroke>
    </MacroEntry>
  </MacroTable>
</AppCfg>

Appended at the bottom is a macro table containing the custom keystrokes for binding onto the SpaceNavigator buttons. Definition alone doesn’t enable functionality, we need to assign these macros to the buttons using the 3Dconnexion Properties GUI.

Overall

We found that binding the keys for panning was okay. Performance stutters from time to time and sometimes the panning feels like it becomes locked (maybe excessive buffering), requiring a quick tap in the opposite direction to disengage. Ultimately, not the most elegant solution, but at least we’ve expanded the utility of our space mouse.


Advertisement

Scroll to Top