Spacemouse Pro isn't working with 2D application

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

pdhakal
Posts: 7
Joined: Wed Aug 02, 2023 9:24 pm

Spacemouse Pro isn't working with 2D application

Post by pdhakal »

Hi,

I'm trying to make the Spacemouse Pro work with a 2D application. Nothing fancy, just need the ability to zoom, pan, rotate and map the keys to the application Clinical Viewer from 3DHistech.

I've noticed that the mouse doesn't work by default with other 2D applications or browsers, etc.

Can someone please guide how to integrate the mouse to a 2D application and also if you have any modules written for integration with 2D, it will help a lot.

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

Re: Spacemouse Pro isn't working with 2D application

Post by jwick »

Without special handling the 3D mouse sends MouseWheel events to unrecognized applications. This normally does scrolling, or scaling/zooming, depending on the application.

It is unlikely that you will be able to make a satisfactory solution on your own for anything more complicated than that. I can try to help you.

In general, applications need to specifically know about the 3D mouse to work best. That is, the software needs to be modified or a plugin developed.
In some application environments it is sometimes acceptable to have the 3D mouse/driver can act like another device or set of devices.

I assume this is a path slide viewer. It is a somewhat often requested usage.
Is it a web browser hosted app? Which browser?
Is there a demo version available?
I have some experimental code that works with some standard web browsers. I'm not convinced it is useful.
pdhakal
Posts: 7
Joined: Wed Aug 02, 2023 9:24 pm

Re: Spacemouse Pro isn't working with 2D application

Post by pdhakal »

Thank you for the reply,

Yes, it's a pathology slide viewer. It's an exe file that needs to be installed locally. But sadly, Clinical viewer needs license to use.

There is however another application that's free to use called Slide Viewer:
https://www.3dhistech.com/mp-files/slideviewer-2-7.exe/

You can use the Slide Viewer to open the demo slide Smiley attached here.

Thank you again for your help.
Attachments
Smiley (1).zip
(25.27 KiB) Downloaded 151 times
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Spacemouse Pro isn't working with 2D application

Post by jwick »

I tested this with smiley. I have also tested it with path slides in the past.

It is up to you to determine if it is useful. Please let us know if you think it is. And what could be done to make it better.
Obviously disconnecting the cursor movement would be ideal, but I don't think that is possible with this method.
I think a way to navigate between slides would be useful. Perhaps using a button. I don't know how to do that in the app. I assume these slide sets are generally related to different samples taken from the same patient (not smiley).

Download and unzip the two files contained in:
https://1drv.ms/u/s!Aqq-8yGT3ygwwyG7Dsl ... N?e=ouCZ1J

Save SlideViewer.xml in %appdata%\3Dconnexion\3DxWare\Cfg. If you have a previous SlideViewer.xml in there, replace it with this.
Save WPPZ.dll into C:\Program Files\3Dconnexion\3DxWare\3DxWinCore\Win64\DLLs (you will need admin privileges to do that)

Restart 3DxService (Start menu).

Open SlideViewer. The 3D mouse will pan the slide in the direction the 3D mouse cap is moved (just like a 2D mouse). When the cursor gets near the edge of the window, it will reset the cursor position to where it started and continue moving. You will feel an annoying hiccup there - the real problem with this implementation. YMMV.

Twisting the cap (like opening a jar) zooms the slide.

Those axes can be reassigned, but it is useful to have zooming on a rotation axis. It doesn't work well when zooming and panning are on the same vector. It's difficult to isolate them with you hand.

This should also work with the official, licensed version, but you may have to change the ExecutableName in the file to whatever the official version name is.

I have also run this with ImageScope and chrome-hosted image viewing apps (changing the ExecutableNames as needed).
pdhakal
Posts: 7
Joined: Wed Aug 02, 2023 9:24 pm

Re: Spacemouse Pro isn't working with 2D application

Post by pdhakal »

Thank you for the files. The pan and zoom are working as mentioned. This is such a good start rather than having just the zoom in and out capability. I agree that its easier to have the zoom on the rotation axis, its easier and more intuitive to navigate the slides. But, we'll still need a way to rotate the slide images, which can be done in the SlideViewer by holding ctrl and moving the mouse in clock or anti-clockwise direction.

We can still rotate pressing the control and moving the Mouse Cap, but this zooms and rotates at the same time, and is very hard to get it right. It would be much better to have the rotate functionality be a standalone movement where it's not affecting the pan or zoom. For example, pressing the cap down or pulling it up would be the rotate options. Please let me know if this could be achieved.

Disconnecting the cursor movement would definitely be much better as the cursor jumps around while using it. There is a shortcut to navigate between the slides in the SlideViewer which is given in the settings, and I was able to map it to the buttons.

Thank you again for the help.
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Spacemouse Pro isn't working with 2D application

Post by jwick »

Try this one
Since you have a SMP, this cfg (and DLL) does image rotation with the Rz axis while holding down the Ctrl key. You should be able to do that one-handed.
Without the ctrl key, it zooms as before.
It is interesting.
pdhakal
Posts: 7
Joined: Wed Aug 02, 2023 9:24 pm

Re: Spacemouse Pro isn't working with 2D application

Post by pdhakal »

Thank you, this is the functionality I was looking for.

There are just two issues:
Panning is extremely slow on Windows 11. I tried on different windows 10 and 11 devices with different specs and screen sizes and resolutions, and the issue persists on Windows 11 devices. On Windows 11, the slides also rotate and zoom at the same time while pressing ctrl key and twisting the cap, which again is fine on windows 10.

Another issue is the image flickers a lot while panning, which causes straining on the eyes. You can see this issue in the SlideViewer application too. It doesn't flicker while panning with normal mouse but does a lot with the SMP.

Thank you again..
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Spacemouse Pro isn't working with 2D application

Post by jwick »

Does this also occur with the smiley file?
Do you have a larger file for me to try?
pdhakal
Posts: 7
Joined: Wed Aug 02, 2023 9:24 pm

Re: Spacemouse Pro isn't working with 2D application

Post by pdhakal »

Hi, I've sent the file and password to your dm. Thank you
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Spacemouse Pro isn't working with 2D application

Post by jwick »

Thanks for the files. Those are some cool images.

I am also running Windows 11. It works well, for what it does. It may be some issue with your machine setup. Sorry I can't offer help there. I'd look at video drivers/settings - make sure it is using the hardware graphics card acceleration.

All the 3Dx software is doing is pressing keys, same as the mouse, but possibly quicker. Any keylogging software might be upset.
Make sure our driver logging is turned off - you would be getting a warning about that daily.

It doesn't run as fast as a 2D mouse. The 3D mouse normally produces events at ~60Hz. The 2D mouse sends events at much higher rates. I can control that. I'll see if it helps.

There are a couple of problems with the circular motion. If it moves the cursor toward the edge of the screen, it might be doing what it does in panning mode - moving the cursor away from the edge. This will affect the circle shape. I noticed that non-circular (Y) motion does zooming when the ctrl key is down. You may have better luck staying away from the edges when starting a rotate.

It also does not handle releasing the ctrl key while moving the cap. It sometimes continues panning.

I will look at those issues.

This is all unsupported experimental code. Though it is interesting how useful we can make it as we spend time on it. While we get a fair amount of interest from pathologists, there are many general image viewing applications. The ultimate goal would be to request the software vendors to support it natively (ImageScope, SlideViewer, etc). This prototyping may help.
pdhakal
Posts: 7
Joined: Wed Aug 02, 2023 9:24 pm

Re: Spacemouse Pro isn't working with 2D application

Post by pdhakal »

Thank you for the info. Higher refresh rates would definitely help, if it reduces the flickering. I've been trying to figure out the windows 11 thing, but no luck so far.

Vendor supporting the product would be lifesaving, but they're not keen on integrating 3rd party products yet, hopefully in the future. There are other products made for digital pathology, but we've found that the scientists and the pathologists prefer the SMP over other curated products, possibly because it's more convenient to handle and use.
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Spacemouse Pro isn't working with 2D application

Post by jwick »

Try this one

The image rotation (Ctrl+Rz) has improved.
The speed has improved.
I've implemented a "Recenter Cursor" function on the Fit button.
It runs very well on my Windows 11 machine. Check for keylogging, anti-virus software if you still experience delays.

It works quite well on large monitors with full screen windows.
pdhakal
Posts: 7
Joined: Wed Aug 02, 2023 9:24 pm

Re: Spacemouse Pro isn't working with 2D application

Post by pdhakal »

Amazing work. Thank you for the files. The functionality has improved significantly. Rotation is significantly better than before. And the screen does not flicker as much when panning.

The slow panning issue with Windows 11 was a setting on the Windows Mouse properties, which I've found is enabled by default on Windows 11. It's under Mouse Properties --> Pointer options --> '"Enhance pointer precision." If this is ticked, the panning is extremely slow. Unticking this has increased the panning speed on Win 11 devices.
d.rob
Posts: 2
Joined: Thu Sep 14, 2023 9:19 am

Re: Spacemouse Pro isn't working with 2D application

Post by d.rob »

jwick wrote: Thu Aug 31, 2023 5:15 am Try this one

The image rotation (Ctrl+Rz) has improved.
The speed has improved.
I've implemented a "Recenter Cursor" function on the Fit button.
It runs very well on my Windows 11 machine. Check for keylogging, anti-virus software if you still experience delays.

It works quite well on large monitors with full screen windows.
I'm having similar issues as the OP.

We use several web-based pathology slide viewers, and I'm having trouble getting this config to work in either Chrome or Edge. I believe I've followed the unzipping instructions correctly, but the only functionality I get in the browser-based viewer is zoom. Are you able to help?

Here's a free web-based slide viewer. Select "continue as guest" and click on any of the images to test.

https://digital.pathology.johnshopkins.edu/
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Spacemouse Pro isn't working with 2D application

Post by jwick »

Hello d.rob,

The driver needs to be told to use these AxisActions for Edge and Chrome. By default, the 3D mouse only zooms in these applications.
This is done with cfg files.

In addition to the package referenced above, you need to add two cfg files to your %appdata%\3Dconnexion\3DxWare\Cfg dir.
E.g.,
Chrome.xml
MsEdge.xml

These settings will be used all the time for Edge and Chrome. There are ways of telling the driver to only use them at certain times, not for every web page. We can look at that if you want to use this in the more general case.

I'm happy with the way this works in SlideViewer, but not thrilled with Edge and Chrome. Those don't have the same responsiveness as SlideViewer.
In particular, the zooming is only somewhat useful because both of these browsers over-react to mousewheel events. They turn one mousewheel tick into a large animated zoom (they do the same for the 2D mouse - maybe there is a way to disable that in the browsers). I'd need to address that before I'd consider this practical. I've turned off zooming for Edge (using our GUI).

You can experiment with it in your environment and let us know how it looks. I'm skeptical.
Post Reply