SpaceMouse Input For Grasshopper

I’d like nComponent to take live vector input from a 3Dconnexion SpaceMouse—the device we normally use to navigate around a model, but which (as far as I know) can’t directly re-orient the mesh itself. My goal is to feed those vectors straight into a Grasshopper component so I can manipulate and align geometry interactively. Ideally, each axis could still be locked independently for precise control, and while the component is active the SpaceMouse’s usual 360-degree viewport navigation would be temporarily disabled to avoid conflicting commands. That would make the workflow both elegant and truly powerful.

I have not tried this.

pyspacemouse·PyPI

Is it possible to integrate this into a Python component within Grasshopper?

I don’t think so.
A few months ago, I made a start on trying to get the space mouse to work to navigate my grasshopper canvas, but ran into a bunch of snags. Rhino doesn’t explose it’s native space mouse input handling, and Grasshopper does not deal well with continuous loops, so feeding any sort of live space mouse input into grasshopper just makes it hang and crash. I must admit I’m not a pro, so if anyone disagrees, please shout out.

I did manage to get raw input data from the space mouse outside of the Rhino environment, by using pywinusb.

If anyone wants to get on board with this, attached is a script that gives access to raw data for any of your USB devices.
There will be several entries for 3Dconnexion. I think the joystick and the buttons are on seperate entries, and 1 seems to be unused. The second entry gave joystick data for me.
USB_HID_info.py (10.3 KB)