how to switch buttonbanks

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
Nonson
Posts: 3
Joined: Fri Jan 17, 2025 5:00 pm

how to switch buttonbanks

Post by Nonson »

Hi all.
I have the SpaceMouse compact. I've been messing with the different XML files for days now and haven't found what I need.

as I understand, there can be a few button banks and axis banks for each app,
and I'm talking about a game, not an app that has a pre-defined configuration.
I am trying to understand how to create the different axis banks and how to switch between them.
i started testing on button banks.

my plan is to switch between 2 button banks with the right button of the SpaceMouse. either by holding, clicking or the radial menu.
one axis bank will be used as a regular mouse and the other will also be used as a mouse but with different modifiers with every axis movement.
The goal is to make the SpaceMouse work differently in different parts of the game.

on an old post i saw how it's suppossed to be done. so i made 2 different button banks with 2 different IDs.
i made a button action with the "GoTo" action and the rest of the parameters for the switch.
I configured my right SpaceMouse button to trigger the switch.

In the game, when I trigger the button bank switch, the XML file is being edited, and the only change is this line:
<CurrentButtonBank>Default</CurrentButtonBank>
turns into this:
<CurrentButtonBank></CurrentButtonBank>
And the button bank is never changed to the second one.

this is the part of my code that handles the bank switch:

Code: Select all

	<ButtonActions>
		<ButtonAction Type="ButtonBank">
			<ID>ButtonBank_GoTo_Default</ID>
			<Name>Default BB</Name>
			<Action>GoTo</Action>
			<ButtonBankID>Default</ButtonBankID>

		</ButtonAction>
		<ButtonAction Type="ButtonBank">
			<ID>ButtonBank_GoTo_Map</ID>
			<Name>Map BB</Name>
			<Action>GoTo</Action>
			<ButtonBankID>Map</ButtonBankID>
		</ButtonAction>
	</ButtonActions>
	
  <Devices>
    <Device>
      <ID>ID_ProductID_C635</ID>
	  
	  <CurrentButtonBank></CurrentButtonBank>
	  
      <ButtonBank Default="true">
        <Name>Default</Name>
        <ID>Default</ID>
        <Button>
          <Input>
            <ActionID>HIDButton_1</ActionID>
          </Input>
          <Output>
            <ActionID>HIDMouse_Right</ActionID>
          </Output>
        </Button>
        <Button>
          <Input>
            <ActionID>HIDButton_2</ActionID>
          </Input>
          <Output>
            <ActionID>ButtonBank_GoTo_Map</ActionID>
          </Output>
        </Button>
      </ButtonBank>	  
	  
	  <ButtonBank>
        <Name>Map</Name>
        <ID>Map</ID>
        <Button>
          <Input>
            <ActionID>HIDButton_1</ActionID>
          </Input>
          <Output>
            <ActionID>HIDMouse_Left</ActionID>
          </Output>
        </Button>
        <Button>
          <Input>
            <ActionID>HIDButton_2</ActionID>
          </Input>
          <Output>
            <ActionID>ButtonBank_GoTo_Default</ActionID>
          </Output>
        </Button>
      </ButtonBank>  
    </Device>
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: how to switch buttonbanks

Post by jwick »

That's a very clever use of a 2 button device.
Another option is to use a RadialMenu. E.g., with an 8 element menu, you could have 4 Axis and 4 Button Bank ops.
There is also an "ApplicationBank" op, which switches both the Button and Axis Banks together to the same BankID.

The correct element is <BankID>. I was probably going for a unified syntax with the AxisBank ops.

Code: Select all

	<ButtonActions>
		<ButtonAction Type="ButtonBank">
			<ID>ButtonBank_GoTo_Default</ID>
			<Name>Default BB</Name>
			<Action>GoTo</Action>
			<BankID>Default</BankID>
		</ButtonAction>
		<ButtonAction Type="ButtonBank">
			<ID>ButtonBank_GoTo_Map</ID>
			<Name>Map BB</Name>
			<Action>GoTo</Action>
			<BankID>Map</BankID>
		</ButtonAction>
	</ButtonActions>
Nonson
Posts: 3
Joined: Fri Jan 17, 2025 5:00 pm

Re: how to switch buttonbanks

Post by Nonson »

I got a little past that and made something that works. It switches between 2-axis banks.
The second axis bank has modifiers. With every X\Y movement, the left or right button is held.
All this works perfectly, the only problem I have is that the software is editing my file and adding more and more modifiers with every click of the "AxisBank_Toggle"
After a few clicks on the bank switch button, I have something like this:
<Modifiers><Modifier>LeftMouse</Modifier><Modifier>LeftMouse</Modifier><Modifier>LeftMouse</Modifier><Modifier>LeftMouse</Modifier</Modifiers>

And it never stops, it just keeps adding more with every click

I tried to make the file read only but then the bank switch doesn't work.
I tried to use goto for the switch, but the same happened.

Is there something wrong with my code?

Code: Select all

  <ButtonActions>
    <ButtonAction Type="AxisBank">
      <ID>AxisBank_Toggle</ID>
      <Action>Next</Action>
    </ButtonAction>
  </ButtonActions>
<Devices>
    <Device>
      <ID>ID_ProductID_C635</ID>
	  	  
      <ButtonBank Default="true">
        <Name>STR_DEFAULT_BUTTONBANK</Name>
        <ID>Default</ID>
        <Button>
          <Input>
            <ActionID>HIDButton_1</ActionID>
          </Input>
          <Output>
            <ActionID>HIDMouse_Left</ActionID>
          </Output>
        </Button>
        <Button>
          <Input>
            <ActionID>HIDButton_2</ActionID>
          </Input>
          <Output>
            <ActionID>AxisBank_Toggle</ActionID>
          </Output>
        </Button>
      </ButtonBank>	  

	</Device>
    
	<Device>
      <ID>ID_Standard_3D_Mouse</ID>

	  <AxisBank Default="true">
        <Name>Default</Name>
        <ID>Default</ID>

		<Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_X</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
			<Deadband>50</Deadband>
          </Input>
          <Output>
            <ActionID>HIDMouse_X</ActionID>
			<Scale>3.5000</Scale>
            <Reversed>false</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Y</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
			<Deadband>50</Deadband>
          </Input>
          <Output>
            <ActionID>HIDMouse_Y</ActionID>
			<Scale>3.5000</Scale>
            <Reversed>false</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Z</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
			<Deadband>10</Deadband>
          </Input>
          <Output>
            <ActionID>HIDMouse_Wheel</ActionID>
            <Reversed>false</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rx</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMouse_Y</ActionID>
			<Scale>1.5000</Scale>
            <Reversed>false</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMouse_X</ActionID>
			<Scale>1.5000</Scale>
            <Reversed>true</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMouse_Wheel</ActionID>
            <Reversed>true</Reversed>
          </Output>
        </Axis>
      </AxisBank>

	  <AxisBank Default="false">
        <Name>Map</Name>
        <ID>Map</ID>
        
		<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_X</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
			<Deadband>150</Deadband>
          </Input>
          <Output>
		    <Modifiers>
				<Modifier>RightMouse</Modifier>
			</Modifiers>
            <ActionID>HIDMouse_X</ActionID>
			<Scale>2.0000</Scale>
            <Reversed>false</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Y</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
			<Deadband>150</Deadband>
          </Input>
          <Output>
		    <Modifiers>
				<Modifier>RightMouse</Modifier>
			</Modifiers>
            <ActionID>HIDMouse_Y</ActionID>
			<Scale>2.0000</Scale>
            <Reversed>false</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Z</ActionID>
            <Min>-512</Min>
            <Max>211</Max>
			<Deadband>10</Deadband>
          </Input>
          <Output>
            <ActionID>HIDMouse_Wheel</ActionID>
            <Reversed>false</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rx</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
			<Deadband>70</Deadband>
          </Input>
          <Output>
		    <Modifiers>
				<Modifier>LeftMouse</Modifier>
			</Modifiers>
            <ActionID>HIDMouse_Y</ActionID>
			<Scale>3.5000</Scale>
            <Reversed>false</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
			<Deadband>70</Deadband>
          </Input>
          <Output>
		    <Modifiers>
				<Modifier>LeftMouse</Modifier>
			</Modifiers>
            <ActionID>HIDMouse_X</ActionID>
			<Scale>3.5000</Scale>
            <Reversed>true</Reversed>
          </Output>
        </Axis>

		<Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID>
            <Min>-512</Min>
            <Max>311</Max>
          </Input>
          <Output>
            <ActionID>HIDMouse_Wheel</ActionID>
            <Reversed>false</Reversed>
          </Output>
        </Axis>
      </AxisBank>  	    
      <AxisFilter>Dominant</AxisFilter>
    </Device>
</Devices>

jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: how to switch buttonbanks

Post by jwick »

Yes, I see that. It's rather annoying, but appears to be harmless.
I'll file a bug report on it.

Thank you for pointing it out.
Post Reply