Map Volume Up/Down to rotation axis Zs?

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
Yogi
Posts: 12
Joined: Wed Jun 29, 2022 4:39 am

Map Volume Up/Down to rotation axis Zs?

Post by Yogi »

I've tried using this without success, the ActionID works on the buttons but not the rotation.

Code: Select all

<Axis>
    <Enabled>true</Enabled>
        <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID>
            <Min>0</Min>
            <Max>511</Max>
            <Deadband>88</Deadband>
        </Input>
        <Output>
            <ActionID>Driver_MediaPlayer_PreviousTrack</ActionID>
        </Output>
 </Axis>
 
Note: It says previous track because I've mapped previous track to volume down in PowerToys (don't ask), feel free to provide the answer for volume down directly. Apologies for the confusion.

Kind regards.
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Map Volume Up/Down to rotation axis Zs?

Post by jwick »

Those functions can only be assigned to buttons.
I like the idea though.

If you can assign them to keyboard keys, you could create an AxisAction to activate them.
Yogi
Posts: 12
Joined: Wed Jun 29, 2022 4:39 am

Re: Map Volume Up/Down to rotation axis Zs?

Post by Yogi »

Thanks for letting me know, I'll stop trying and will do the key remap instead, thanks again, jwick, appreciate all your support.
Yogi
Posts: 12
Joined: Wed Jun 29, 2022 4:39 am

Re: Map Volume Up/Down to rotation axis Zs?

Post by Yogi »

I'm having a bit of trouble, I haven't used it in a while, I reset all my settings and upgraded to the newest software but it seems my previous methods aren't working....

Does anything stick out to you? I'm just trying to test the basic key 1E, which should output 1:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><!--
(c) Copyright 3Dconnexion. All rights reserved. 
$Revision: 20112 $
--><Global xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Default="false" CfgFormatVersion="1.3" ThisFileVersion="1.34">
  <CfgProperties>
    <ID>ID_Global_Cfg</ID>
    <InheritsFromID>ID_Global_Cfg</InheritsFromID>
    <Name>STR_GLOBALCFG</Name>
  </CfgProperties>
  <Settings>
    <LEDsEnabled>false</LEDsEnabled>
    <InstallerAutoCheckForUpdates>true</InstallerAutoCheckForUpdates>
    <LastAutoCheckForUpdates>24-7-2023</LastAutoCheckForUpdates>
  </Settings>
  <AuthorInfo>
    <DriverVersion>17.8.14.20165</DriverVersion>
    <LastChange>
      <Tool>3DxService.exe</Tool>
      <Version>17.8.14.20165</Version>
      <Date>2023:7:1:24:13:48:32:174</Date>
      <User>User</User>
    </LastChange>
    <Created>
      <Tool>3DxService.exe</Tool>
      <Version>17.8.14.20165</Version>
      <Date>2023:7:1:24:13:43:54:884</Date>
      <User>User</User>
    </Created>
  </AuthorInfo>
  <Devices>
    <Device>
      <ID>ID_ProductID_C652</ID>
      <Settings>
        <OnScreenDisplay>
          <AlwaysOn>true</AlwaysOn>
        </OnScreenDisplay>
      </Settings>
    </Device>
	<Device>
      <ID>ID_Standard_3D_Mouse</ID>
	  <AxisBank>
        <Name>Default</Name>
        <ID>Default</ID>
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID>  <!-- description -->
            <Min>0</Min>
            <Max>511</Max>
           <Deadband>88</Deadband>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
	    <RepeatStyle>PressAndHold</RepeatStyle>
            <MaxEventRate>0.25</MaxEventRate>
            <KeyStroke>
              <Key>1E</Key>
            </KeyStroke>
          </Output>
        </Axis>
	<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID> <!-- description -->
            <Min>-512</Min>
            <Max>0</Max>
            <Deadband>88</Deadband>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
	    <RepeatStyle>PressAndHold</RepeatStyle>
            <MaxEventRate>0.25</MaxEventRate>
            <KeyStroke>
              <Key>1E</Key>
            </KeyStroke>
          </Output>
        </Axis>
	</AxisBank>
      <AxisFilter>Dominant</AxisFilter>
    </Device>
  </Devices>
</Global>
Yogi
Posts: 12
Joined: Wed Jun 29, 2022 4:39 am

Re: Map Volume Up/Down to rotation axis Zs?

Post by Yogi »

This may make it easier to read the relevant section:
Image
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Map Volume Up/Down to rotation axis Zs?

Post by jwick »

When I cut&paste that <Device> into my %appdata%/Global.xml, it outputs 1111111... into notepad. I assume it will work everywhere.
What happens on your machine?
The %localappdata%\3Dconnexion\3DxWare\3DxService.log file will tell you what it is doing.
Yogi
Posts: 12
Joined: Wed Jun 29, 2022 4:39 am

Re: Map Volume Up/Down to rotation axis Zs?

Post by Yogi »

-- Apologies, I got it working! Just had to restart the system.

I hope I didn't make you read all that first, couldn't figure out how to edit messages.

Thanks again.

For anyone else, I assigned them to F13 and F14, then used PowerToys to remap the keys to volume up and down.

Where it says KeyStroke><Key> put in 68 for one, 69 for the other to get F13 and F14 (forgot which is which, but it doesn't matter as you just rotate it in PowerToys for the input.

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

Re: Map Volume Up/Down to rotation axis Zs?

Post by jwick »

We've seen some conflicts with multi-key keyboard macros with PowerToys. IIRC, it can cause rearrangement of the keys.
Yogi
Posts: 12
Joined: Wed Jun 29, 2022 4:39 am

Re: Map Volume Up/Down to rotation axis Zs?

Post by Yogi »

Appreciate the warning thank you. So far I haven't noticed any issues but will keep an eye out for them.

I was wondering, now that I have F13 and F14 mapped to the Rz axis globally, if I wanted to have the Rz behave normally for specific applications, is there anything I can do for their configs?

Or should I have done it the other way round and set the volume up and down for every other app that isn't one of the 3D ones...
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Map Volume Up/Down to rotation axis Zs?

Post by jwick »

There are many ways of doing this.
It would be very annoying to have to add these assignments to every cfg.

There are BankOperations where you can use a device button to change CurrentAxisBank. You can do this temporarily, like a shift key.
You would hold down (or toggle) a SpaceMouse key, then your cap would be in volume control mode. Release (toggle) the key to return to normal mode.

Generally it is used for ButtonBank operations, but the same should work for AxisBanks. Or you can shift/toggle ButtonBanks and AxisBanks together with one button.

Some of this is included in some forum posts. I'd have to look where those are.

It may be easier just to use the Desktop toggle method to switch to the "desktop/2D cfg". People use that to toggle the 3D mouse into/out of 2D mouse mode. There is a preassigned ButtonAction for that. You would put your Volume adjusters into Desktop.xml.
Yogi
Posts: 12
Joined: Wed Jun 29, 2022 4:39 am

Re: Map Volume Up/Down to rotation axis Zs?

Post by Yogi »

Thank you very much for the advice. I did not find the preassigned ButtonAction in the GUI for it but I managed to get it working to toggle on button 2 with the following (using https://forum.3dconnexion.com/viewtopic.php?p=116919 as a guide):

Global.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><!--
(c) Copyright 3Dconnexion. All rights reserved. 
$Revision: 20112 $
--><Global xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Default="false" CfgFormatVersion="1.3" ThisFileVersion="1.34">
  <CfgProperties>
    <ID>ID_Global_Cfg</ID>
    <InheritsFromID>ID_Global_Cfg</InheritsFromID>
    <Name>STR_GLOBALCFG</Name>
  </CfgProperties>
  <Settings>
    <InstallerAutoCheckForUpdates>true</InstallerAutoCheckForUpdates>
    <LastAutoCheckForUpdates>25-7-2023</LastAutoCheckForUpdates>
    <LogLevel>0</LogLevel>
  </Settings>
  <AuthorInfo>
    <DriverVersion>17.8.14.20165</DriverVersion>
    <LastChange>
      <Tool>3DxService.exe</Tool>
      <Version>17.8.14.20165</Version>
      <Date>2023:7:2:25:17:12:54:720</Date>
      <User>SpaceMouseFan</User>
    </LastChange>
    <Created>
      <Tool>3DxService.exe</Tool>
      <Version>17.8.14.20165</Version>
      <Date>2023:7:1:24:13:43:54:884</Date>
      <User>User</User>
    </Created>
  </AuthorInfo>
  <ButtonActions>
    <ButtonAction Type="Driver_Other">
      <ID>Driver_Desktop_ToggleGrab</ID>
      <Name>STR_DRIVER_DESKTOP_TOGGLEGRAB</Name>
      <Image>
        <Source>[driver_images:Driver_Desktop_ToggleGrab.png]</Source>
      </Image>
    </ButtonAction>
  </ButtonActions>
  <Devices>
    <Device>
      <ID>ID_ProductID_C652</ID>
      <Settings>
        <OnScreenDisplay>
          <AlwaysOn>true</AlwaysOn>
        </OnScreenDisplay>
      </Settings>
    </Device>
	<Device>
      <ID>ID_Standard_3D_Mouse</ID>
      <ButtonBank Global="true">
        <ID>Global Global</ID>
        <Name>Global</Name>
        <Button>
          <Input>
            <ActionID>V3DK_MENU_2</ActionID>
          </Input>
          <Output>
            <ActionID>Driver_Desktop_ToggleGrab</ActionID>
          </Output>
        </Button>
      </ButtonBank>
    </Device>
  </Devices>
</Global>
And for Desktop.xml:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?><AppCfg Default="false" xmlns="" CfgFormatVersion="1.3" ThisFileVersion="1.10">
	<AppInfo>
		<Signature>
			<Name>STR_DESKTOP</Name>
		</Signature>
		<Options/>
	</AppInfo>
	<CfgProperties>
		<ID>ID_Desktop_Cfg</ID>
		<Name>STR_DESKTOP</Name>
		<InheritsFromID>ID_Desktop_Cfg</InheritsFromID>
		<Grab>Hard</Grab>
	</CfgProperties>
	<AuthorInfo>
		<DriverVersion>17.8.14.20165</DriverVersion>
		<LastChange>
		  <Tool>3DxService.exe</Tool>
		  <Version>17.8.14.20165</Version>
		  <Date>2023:7:2:25:17:25:38:788</Date>
		  <User>SpaceMouseFan</User>
		</LastChange>
		<Created>
		  <Tool>3DxService.exe</Tool>
		  <Version>17.8.14.20165</Version>
		  <Date>2023:7:1:24:13:43:54:884</Date>
		  <User>yasir</User>
		</Created>
	</AuthorInfo>
	<Devices>
		<Device>
      <ID>ID_Standard_3D_Mouse</ID>
      <AxisBank>
        <Name>Default</Name>
        <ID>Default</ID>
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID>
            <!-- description -->
            <Min>0</Min>
            <Max>511</Max>
            <Deadband>88</Deadband>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
            <RepeatStyle>PressAndHold</RepeatStyle>
            <MaxEventRate>0.2500</MaxEventRate>
            <KeyStroke>
              <Key>68</Key>
            </KeyStroke>
          </Output>
        </Axis>
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID>
            <!-- description -->
            <Min>-512</Min>
            <Max>0</Max>
            <Deadband>88</Deadband>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
            <RepeatStyle>PressAndHold</RepeatStyle>
            <MaxEventRate>0.2500</MaxEventRate>
            <KeyStroke>
              <Key>69</Key>
            </KeyStroke>
          </Output>
        </Axis>
      </AxisBank>
      <AxisFilter>Dominant</AxisFilter>
    </Device>
	</Devices>
</AppCfg>
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Map Volume Up/Down to rotation axis Zs?

Post by jwick »

You are getting good at this.
Post Reply