Use 3DConnexion mouse as 2D

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

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

Re: Use 3DConnexion mouse as 2D

Post by jwick »

Rather than make everyone wait until I email files, let me try to explain the capabilities so you can make changes yourself.

Everything to control the driver is determined by entries in human-readable XML files. If you make a valid change in a file, it will be used. Our GUI just makes changes to XML files. You can do that yourself. If you make an XML syntax error, the file will be discarded (moved to a bak dir). Don't worry about experimenting. You can't break anything that can't be fixed by deleting some files.

There are two aspects of the files that were being sent out that are significant.

1) Current (last year or so) driver releases have the ability to globally grab controls on a device. That is, no matter which application is in focus, the device control will do the same thing. For this usage, a device button can be assigned to always switch between 2D and 3D modes.

2) We ship a cfg file "Desktop.xml", that is traditionally used to define 2D mouse operations. The global assignment mentioned above switches to and from this cfg file. It could contain 2D mouse assignments, but it does not by default. You can add these assignments to your user changes (stored in %appdata%\3Dconnexionn\3DxWare\Cfg\Desktop.xml).

The GUI (3Dconnexion Settings, 3DxSmartUI.exe)
The global assignment is not shown correctly in the GUI. The GUI will show the wrong assignment; the one that changes with the application.
OTOH, once switched to an "alternate cfg", the GUI can be used to make changes. In this case, you can make changes to Desktop.xml and they will be used when switched to Desktop.xml. E.g., you could assign mouse buttons, kb shortcuts, executable launches, etc. that are now available at the press of a button no matter which application you are in.

The use is as such:
A) Use the 3D device as a 3D device in a 3Dmouse-aware application.
B) Press this 2D/3D button to switch to 2D mode. The 3D device cap now controls the cursor position and the device buttons do whatever you have assigned. E.g., you can use it to move over to another window and press a button assigned to the LeftMouseButton to click focus into that window.
C) Press the 2D/3D button to switch back to 3D mode.

Caveat emptor, it doesn't make a great 2D mouse, too much acceleration IMO. I could probably improve that...

The changes.
For #1, you need to add these lines in your %appdata%\3Dconnexion\3DxWare\Cfg\Global.xml file. You should have one of those if you ever ran the driver.

Code: Select all

  <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>
If you already see a <ButtonActions> section, add the <ButtonAction> inside that. Do not add a new <ButtonActions> section.
This adds a ButtonAction that switches between 2D and 3D modes.

After this add:

Code: Select all

  <Devices>
    <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>
Similarly don't add a new <Devices> section if your file already has one. Only add the <Device>. If you already have a <Device> for ID_Standard_3D_Mouse, you need to add the ButtonBank section to that. "Global=true" is the most important entry here. If you need help merging this in, contact me.

This assigns the 2D/3D ButtonAction to the generic V3DK_MENU_2 button on every 3D mouse. That button exists on all 2 button devices. If you want to assign it to a different button on a different device you need the correct ID. This can be found in a file we ship at %ProgramFiles%\3Dconnexion\3DxWare\3DxWinCore\cfg\Base.xml.
E.g., for button "1" on a SpaceMouse Pro, you will find

Code: Select all

    <Device>
      <ID>ID_ProductID_C62B</ID>
      <Name>SpaceMouse Pro</Name>
      ...
          <ButtonID>HIDButton_13</ButtonID>
          <V3DKID>V3DK_1</V3DKID>
          <ParentID>V3DK_1</ParentID>
in Base.xml.

Put V3DK_1 in Button/Input/ActionID instead of V3DK_MENU_2. That would make the "1" button on your SMP into a 2D/3D toggle button. But only you know that.

For #2, you need changes to your user Desktop.xml. You probably don't have one of those. Save this into %appdata%\3Dconnexion\3DxWare\Cfg\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>None</Grab>
	</CfgProperties>
	<AuthorInfo>
		<DriverVersion>17.8.2.18778</DriverVersion>
		<LastChange>
			<Tool>3DxService.exe</Tool>
			<Version>17.8.2.18778</Version>
			<Date>2021:10:4:7:6:15:49:69</Date>
			<User>jwick</User>
		</LastChange>
		<Created>
			<Tool>3DxService.exe</Tool>
			<Version>17.8.2.18778</Version>
			<Date>2021:10:4:7:6:5:17:234</Date>
			<User>jwick</User>
		</Created>
	</AuthorInfo>
	<Devices>
		<Device>
			<ID>ID_Standard_3D_Mouse</ID>
			<AxisBank Default="true">
				<Name>STR_DEFAULT_BANK</Name>
				<ID>Default</ID>
				<Axis>
					<Enabled>true</Enabled>
					<Input>
						<ActionID>HIDMultiAxis_Rx</ActionID>
						<Min>-512</Min>
						<Max>511</Max>
					</Input>
					<Output>
						<ActionID>HIDMouse_Y</ActionID>
					</Output>
				</Axis>
				<Axis>
					<Enabled>true</Enabled>
					<Input>
						<ActionID>HIDMultiAxis_Ry</ActionID>
						<Min>-512</Min>
						<Max>511</Max>
					</Input>
					<Output>
						<ActionID>HIDMouse_X</ActionID>
						<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>
					</Output>
				</Axis>
			</AxisBank>
			<ButtonBank Default="true">
				<Name>STR_DEFAULT_BUTTONBANK</Name>
				<ID>Default</ID>
				<InheritsFromID/>
				<Button>
					<Input>
						<ActionID>V3DK_MENU_1</ActionID>
					</Input>
					<Output>
						<ActionID>HIDMouse_Left</ActionID>
					</Output>
				</Button>
			</ButtonBank>
		</Device>
	</Devices>
</AppCfg>
This adds assignments for sending 2D mouse events on rolling the cap to/fro and left/right. You can also make other axes do that by changing to or adding assignments for them (e.g., pushing left/right, to/fro). It's personal preference whether tilting like a joystick is better than pushing.
The Rz axis (like opening a jar) is assigned to the MouseWheel. Using quite a separate axis, we think, makes it easier to do this action w/o accidentally invoking one of the other axes. With a real 2D mouse, it is a different physical control, so you don't have this problem.

The V3DK_MENU_1 button is assigned to the LeftMouseButton. IIRC, this was the original request from the OP. This user requested using a SpaceMouse Wireless as a 2D mouse with left button working as a LMB and the right button switching between 2D/3D modes. It is very limiting having only two buttons. If you have different buttons, as above, you can switch this assignment to a different button. E.g., the Alt button to the left of the cap on the SMP.

Hopefully that gets you going. I expect this syntax to remain valid for the foreseeable future. But as with all changes made without the GUIs help, these things are untested and officially unsupported. It may break. OTOH, I would be very happy to hear from you if it breaks, so I can fix it!!

There's a distinct possibility that I have made an error here. I'll fix this post to fix it or add more info as needed.
mhoopes
Posts: 139
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Use 3DConnexion mouse as 2D

Post by mhoopes »

Jim,

I adapted your instructions for my system, with a slightly different approach. I wanted to make the Driver_Desktop_ToggleGrab available for assignment in the GUI, and globally assign it to the [4] button on my NumPad Pro.

1. Created the %appdata%\3Dconnexion\3DxWare\Cfg\Desktop.xml file with the content as jwick instructed above. This enables the 2D option, where Rx = Y and Ry = X mouse pointer movement.
2. Added the following code to %appdata%\3Dconnexion\3DxWare\Cfg\Global.xml:

Add Desktop Mode On/Off to the GUI. This allows it to be easily assigned in specific applications. It's not necessary, unless the user wants to use the GUI to add this function to a macro, button, radial menu, etc. I added this in case I want to easily re-assign it to another input.

Code: Select all

  <UI>
    <ButtonFlyouts>
      <Category Sort="false">
        <ID>UI_3Dx</ID>
        <Name>STR_UI_3DX</Name>
        <ButtonAction><ID>Driver_Desktop_ToggleGrab</ID></ButtonAction>		
      </Category>
    </ButtonFlyouts>
  </UI>
Add Desktop Mode On/Off ButtonAction as instructed:

Code: Select all

 <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>
3. Assigned button [4] on the NumPad Pro to Desktop Mode On/Off:

Code: Select all

  <Devices>
    <Device>
      <ID>ID_ProductID_C665</ID>
      <ButtonBank Default="true">
        <Name>STR_DEFAULT_BUTTONBANK</Name>
        <ID>Default</ID>
		<Button>
          <Input>
            <ActionID>HIDButton_196</ActionID>
          </Input>
          <Output>
            <ActionID>Driver_Desktop_ToggleGrab</ActionID>
          </Output>
        </Button>
      </ButtonBank>
    </Device>
  </Devices>
It's an interesting interface; perhaps there's somewhere I could use it. It reminds me of an etch-a-sketch when used in a drawing program, with "stepping" increasingly evident in non-orthogonal lines the faster the pointer is moved. I do notice an occasional wheel-down operation occurring during X+ movements.
Michael Hoopes
delaney
Posts: 1
Joined: Tue Mar 21, 2023 2:05 pm

Re: Use 3DConnexion mouse as 2D

Post by delaney »

Hi can you send me the file to use the 3DConnexion Spacemouse Wireless as a 2D mouse to work with the latest driver (3/21/2023) please?
Email: <removed email address>
Jyabil
Posts: 1
Joined: Wed Mar 22, 2023 5:42 am

Re: Use 3DConnexion mouse as 2D

Post by Jyabil »

I would also like the file to setup my spacemouse wireless as a 2D mouse.
AlbertHu
Posts: 2
Joined: Wed Mar 29, 2023 6:54 am

Re: Use 3DConnexion mouse as 2D

Post by AlbertHu »

I would also like the file to setup my spacemouse wireless as a 2D mouse.
Can you send me these files?

Thanks!
Nikko
Posts: 2
Joined: Thu Aug 03, 2023 3:42 pm

Re: Use 3DConnexion mouse as 2D

Post by Nikko »

The global xml is sent to the bin whenever I paste the suggested code into it. Any help is greatly appreciated.
Nikko
Posts: 2
Joined: Thu Aug 03, 2023 3:42 pm

Re: Use 3DConnexion mouse as 2D

Post by Nikko »

I forgot to mention in my previous post. I am using the latest driver and I have a SpaceMouse Pro. Thank you for your time and consideration!
jwick
Moderator
Moderator
Posts: 3340
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Use 3DConnexion mouse as 2D

Post by jwick »

Nikko wrote: Thu Aug 03, 2023 3:50 pm The global xml is sent to the bin whenever I paste the suggested code into it. Any help is greatly appreciated.
If there is a problem reading a cfg file, the error should be logged in the driver's log file.
To turn on the log file, right click on the 3Dx systray icon->Write Log File.
The log file is: %localappdata%\3Dconnexion\3DxWare\3DxService.log.
Search for global.xml...
If it doesn't tell you what was wrong, send the file to me and I'll have a look.
marius
Posts: 5
Joined: Mon Apr 05, 2021 12:23 pm

Re: Use 3DConnexion mouse as 2D

Post by marius »

I understand this mouse can be used like 2D on my computer simply uninstalling the driver and connecting straight in may Mac.The computer will recognize the Spacemouse wireless Pro immediately and will act accordingly like 2D mouse.The single glitch - no right click.
Scroll up/down turning the knob.Left click press the knob,Move around the pages - move around the knob,drag/drop - press the knob and keep
pressed than drag the file,article,etc.

Hope use full for somebody,
Marius
Glodigit
Posts: 4
Joined: Mon Apr 03, 2023 3:37 pm

Re: Use 3DConnexion mouse as 2D

Post by Glodigit »

I'm currently working on a 3DxPoint.dll (3DxWare Trackpoint) because my actual mouse finally broke.

So far, I've implemented the following:
  • Translate the cursor by translating the spacemouse.
  • Smooth scroll (like with a trackpad/touchscreen) by twisting.
  • Slow down / speed up the cursor and scroll by lowering/lifting.
    • For example, slowing down for more precision to click a UI element or beign able to quickly scroll to the top of a page.
  • The ButtonRing, featuring 24 virtual buttons that are activated by tilting the spacemouse by a certain amount towards one of 8 directions.
  • Mirroring the ButtonRing, scroll direction or both by use of physical or virtual button.
    • This is mainly used for switching between left/right hands.
I use a SpaceExplorer, so I've only tested on 3DxWare 10.6.4.

Hopefully, I'd get the DLL and Visual Studio project files up on Github shortly, after I've made a few more refinements.
rstadie
Moderator
Moderator
Posts: 777
Joined: Tue Sep 25, 2007 6:18 am
Location: Munich, Germany
Contact:

Re: Use 3DConnexion mouse as 2D

Post by rstadie »

Robert Stadie
Post Reply