FreeSpacenav / spacenavd

Free user-space driver for 6-dof space-mice.
http://spacenav.sourceforge.net
GNU General Public License v3.0
274 stars 55 forks source link

Buttons on SpaceMouse Enterprise do nothing #45

Closed dyaso closed 3 years ago

dyaso commented 3 years ago

The device has 31 buttons which don't currently do anything.

If at least the Shift and Control keys could be made to work that'd help me a lot, but I have no idea how to help -- I've tried running xev but no events seem to be sent.

jtsiomb commented 3 years ago

libspnav comes with an example program (libspnav/examples/simple) which prints all the events received by spacenavd. You can use that to test the buttons, and to figure out which button corresponds to which number, so that you can set up key mappings in /etc/spnavrc. See the example configuration file (spacenavd/doc/example-spnavrc) the section starting with "Map buttons to keyboard keys".

dyaso commented 3 years ago

Thanks for your help!

When I make a remapping in /etc/spnavrc it doesn't do anything, but the button stops being reported as pressed by the examples/simple_af_unix program until I un-remap it. xev still doesn't see it.

less /var/log/spnavd.log reads

reading config file: /etc/spnavrc
adding device.
device name: 3Dconnexion SpaceMouse Enterprise
using device: 3Dconnexion SpaceMouse Enterprise (/dev/input/event0)
Invalid MIT-MAGIC-COOKIE-1 keyfailed to open X11 display ":0.0"

if that's significant?

jtsiomb commented 3 years ago

Yes of course that's significant. If spacenavd can't connect to the X server, then it can't send keyboard events. Also the UNIX socket protocol will work (simple_af_unix) but the X11-based protocol won't (simple_x11). See FAQ number 10: http://spacenav.sourceforge.net/faq.html#faq10

dyaso commented 3 years ago

Apologies for not having read the FAQ, and wasting your time. Button remapping works now, barring several buttons which all identify as #0.

How plausible would it be to have buttons send Ctrl+Z / Shift+Ctrl+Z key combinations with a single press? I realize I'd probably have to modify spacenavd somewhere. Just remapped F1 and F5 in Blender to Undo / Redo, which works for now. (I'm sculpting with a graphics tablet pen in one hand, space mouse controller in the other, which makes switching to keyboard less than comfortable.)

jtsiomb commented 3 years ago

It's not possible currently to send multiple key events, but there's no reason why it couldn't be done. If you wish open a feature request (marked enhancement) about it.