Wykres commitów

252 Commity (master)

Autor SHA1 Wiadomość Data
John Tsiombikas 5d0a9639c4 enable extended buttons on magellan spacemice 2024-03-20 06:48:03 +02:00
John Tsiombikas 1d6fde6676 added swap/invyz flags to the CadMan USB and SB5000 USB
Resolves github issue #93
2024-02-16 15:37:03 +02:00
John Tsiombikas a2d121af16 update FreeBSD auto-build 2023-11-10 14:56:53 +02:00
John Tsiombikas 9b46aebfee added missing set/get requests for the repeat interval 2023-07-17 17:02:14 +03:00
John Tsiombikas 15e6848716 build on IRIX 2023-04-02 04:53:11 +03:00
Rickard Lind 220436cd32 Ignore Keyboard Pro/Numpad Pro (untested!)
Finishing off with adding Keyboard Pro and Numpad Pro for completeness.
Added from this list (which I think has got all handled IDs listed except c62c, c636, c640, and c641): https://3dconnexion.com/uk/support/faq/how-can-i-check-if-my-usb-3d-mouse-is-recognized-by-windows/
2023-03-25 12:56:53 +02:00
Rickard Lind 6df0c8d7d3 Ignore CadMouse Compact Wireless (untested!) 2023-03-23 16:47:57 +02:00
Rickard Lind 54e8333c6e Ignore CadMouse Pro* (untested!)
I have taken the liberty of adding the rest of the CadMouse Pro listed here: https://3dconnexion.com/cadmouse/
The USB IDs are untested and compiled from usb.ids and https://github.com/guillaumechauvat/cadmousectl
2023-03-23 16:43:28 +02:00
Rickard Lind 83d45dd3a5 Ignore CadMouse Compact 2023-03-22 23:21:57 +02:00
John Meacham edeb9bf3e2
Handle NULs sent when serial device powers up correctly. (#79)
The serial IBM spaceball 4000FLX may produce serial data before the @RESET\r
that contains nuls causing the strstr to end early.

---------

Co-authored-by: John Tsiombikas <nuclear@member.fsf.org>
2023-02-27 04:18:14 +02:00
John Tsiombikas d186c5d6ae minor dominant axis code fixes
- fixed scope of new variables to static.
  - fixed C99 struct initialization.
  - removed unnecessary timecmp/timediff and oneline threshold function.
2023-02-22 20:15:04 +02:00
Alberto Fanjul 3bcaf90519 Select dominant rotation/translation
Based on a movement treshold and allowing to reset after some inactivity
2023-02-22 20:15:04 +02:00
John Tsiombikas d537c9b002 fix button mapping for SpaceMouse Pro
I expected the SpaceMouse Pro to report 256 buttons like the SpaceMouse
Enterprise, and was too cautious in dropping the remapping otherwise. It
turns out it reports 15 buttons, but still produces disjointed button
numbers. So remove the check and just log the reported number of buttons
before remapping for future debugging.
2022-12-11 21:27:43 +02:00
John Tsiombikas 0469e67524 added FreeBSD automated github build 2022-11-30 02:56:51 +02:00
John Tsiombikas 1723bcb3f7 added automated github build status on the readme 2022-11-30 01:59:34 +02:00
John Tsiombikas a9c7cce212 actually disable X11 in no-x11 automated build jobs 2022-11-30 01:54:44 +02:00
John Tsiombikas 6640a155b0 added no-x11 build to macosx automated build script 2022-11-30 01:51:29 +02:00
John Tsiombikas 2e4909cd51 merged automated GNU/Linux build with and without X11 support into one 2022-11-30 01:34:50 +02:00
John Tsiombikas 6bc733eaae added MacOSX automated build file 2022-11-30 01:26:59 +02:00
John Tsiombikas 9b8d20e52d Adding automated github build files 2022-11-30 01:22:40 +02:00
John Tsiombikas aebe1999a6 FreeBSD USB: added fake hardcoded device parameters in lieu of actual info
The FreeBSD USB code is incomplete, and doesn't really to device
parameter detection yet, leaving the number of buttons and axes 0. This
might cause problems with programs expecting (reasonably) 6 axes, and
"some" buttons. So let's hardcode 6 and 2 respectively until the code is
improved.
2022-11-30 01:02:47 +02:00
John Tsiombikas d8f6de4697 Improved serial spaceball compatibility
Some times, or some devices do not seem to send a CR before the first
initialization line (@1), and would not get picked up by spacenavd,
which was matching "\r@1". Removing the CR from the test should not
introduce false positives, as I don't think magellan devices send any
similar strings, so it should be safe to just look for "@1".

Also some devices seem to take a little too long to initialize and miss
our initialization string. Adding a 1second sleep after opening the
device seems to help.

Thanks to Benjamin Bergman for debugging and reporting this.
2022-11-29 19:34:19 +02:00
John Tsiombikas b26464190f Fixed incorrect number of stop bits for serial magellan devices.
Closes issue #75
2022-11-29 18:53:23 +02:00
John Tsiombikas b748b4d980 added example spnavrc with SpaceMouse Enterprise button bindings 2022-08-26 22:54:36 +03:00
John Tsiombikas ea02aee368 fix crash when saving configuration, and the file did not already exist 2022-08-26 22:53:20 +03:00
John Tsiombikas 919a86f6b5 linux evdev: detect the button base instead of hardcoding 256
Some old USB devices report themselves as joysticks, which prompts linux
to start their button number from BN_JOYSTICK (0x120) instead of BN_MISC
(0x100). Spacenavd previously assumed the later and subtracted 256 from
button numbers, which causes an offset of 32 to all button events on the
Magellan SpaceMouse USB. This fix adds a bnbase field to the device
structure, which is detected and set automatically in the button
counting loop.
2022-08-26 17:16:59 +03:00
John Tsiombikas b6351158fa added example spnavrc with SpacePilot button mappings 2022-08-26 16:45:48 +03:00
John Tsiombikas 3e1cbc52ef Wireless device detection, and CadMouse avoidance logic
New 3dconnexion devices seem to all use the same dongle with USB id
256f:c526. That includes at least the SpaceMouse Wireless and the
CadMouse Wireless. This is a set of hacks to guess what's connected
and act accordingly:

  - Drop the CadMouse (num_axes == 0)
  - Enable the button hack if it's a SpaceMouse Pro Wireless
  - Detect SpaceMouse Wirless and update name/type.

Also added a test for the assumption that devices marked for button
remapping always report 255-256 buttons. If that's not the case undo the
button-hack and ask the user to report it as a bug.
2022-08-26 16:39:26 +03:00
John Tsiombikas 21d90d0db6 linux hotplug: delayed activation to avoid multiple hotplug triggers 2022-08-26 15:39:07 +03:00
John Tsiombikas 8a3c9617a5 Button remapping hack for devices with non-contiguous button numbers
Some devices are reporting arbitrary non-contiguous button numbers,
while spacenavd expects a contiguous range. Those devices also report
256 buttons regardless of the true number.

Introduced a button remapping hack for problematic devices, which
hardcode the correct number of buttons and arbitrarilly remaps them to a
continuous 0-base range. This should fix the button number issues with
the SpaceMouse Enterprise and SpaceMouse Pro.

Also added a second level of verbosity, to lighten the logging output
under normal `-v` conditions.
2022-08-26 15:06:38 +03:00
John Tsiombikas a067ab7a2d we have to link libm since we're using isfinite() 2022-08-22 03:57:38 +03:00
John Tsiombikas 2c5a443bf5 allow passing a null pointer to send_string, and send an empty string 2022-04-26 17:23:17 +03:00
John Tsiombikas 8383f8d493 fixed compatibility with newer magellan clients 2022-04-09 06:51:22 +03:00
John Tsiombikas 01634327c3 README: button names wiki call for help 2022-04-02 15:19:20 +03:00
luz paz 601817f03f README: fix typo 2022-04-01 21:57:55 +03:00
John Tsiombikas 223d170aef updated README 2022-04-01 05:19:11 +03:00
John Tsiombikas 8355311364 fixed config save routine: was missing bnact handling 2022-04-01 04:07:42 +03:00
John Tsiombikas 3a005aa21b now that the serial device path can be changed through the API by any
unpriviledged client, we can't trust it blindly any more. Added checks
to make sure it's a TTY before trying to use it.
2022-03-30 23:04:53 +03:00
John Tsiombikas c58eaa3bba better handling of config file updates 2022-03-28 19:05:24 +03:00
John Tsiombikas b19e9c5bb1 stop sending invalid X events 2022-03-27 18:56:24 +03:00
John Tsiombikas 9020967ddb - fix memory leak when re-reading config file
- better logging for X errors
2022-03-27 13:15:59 +03:00
John Tsiombikas 0f1f40f38e proto: better SCFG_KBMAP handling 2022-03-26 23:23:58 +02:00
John Tsiombikas b922cb75f8 - added raw axis/button events
- fixed dropping events when the client's event mask doesn't match
2022-03-26 15:06:03 +02:00
John Tsiombikas 3fb72ed7ef proto: send response after save/load commands complete 2022-03-26 13:19:47 +02:00
John Tsiombikas 945fba993b proto: allow sending empty strings 2022-03-25 12:18:57 +02:00
John Tsiombikas 60cb7f6f13 handle axis mappings consistently across all known devices, and drop
swap-by-default logic. Whether the low level axis mappings are
consistent for some of the devices are just guesswork at this point
until we get more data.
2022-03-25 11:53:10 +02:00
John Tsiombikas 743d5eb3f1 proto.h/proto.c files are shared with libspnav, add spnav_ prefixes to
all global symbols to avoid namespace pollution there.
2022-03-24 17:52:38 +02:00
John Tsiombikas a6e9f4b2ca improved string handling in the wire protocol 2022-03-23 22:16:53 +02:00
John Tsiombikas 34adbc5799 - made all protocol structures explicitly carry int32_t instead of int
- fixed serial_dev_open over-writing the device name with "serial device"
- hotplug does not need to call init_devices now that we split them up,
  it's best to call init_serial_devices instead.
- preparing for reworking the string passing mechanism in protocol v1
2022-03-23 11:42:08 +02:00
John Tsiombikas 88585ca7d1 - fixed axis/button reporting (AF_UNIX protocol) for serial devices.
- changed the meaning of swap-yz to make it more intuitive, I'll fix the
  USB devices handling which are backwards later at the device level.
- implemented SCFG_SERDEV/GCFG_SERDEV requests (AF_UNIX protocol).
2022-03-23 03:18:13 +02:00