how to switch buttonbanks

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
Nonson
Posts: 2
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: 3417
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>
Post Reply