Wykres commitów

173 Commity (master)

Autor SHA1 Wiadomość Data
John Tsiombikas 9751030bfc implemented dominant axis mode properly. fixes github issue #84 2024-06-03 04:25:18 +03:00
John Tsiombikas ed8d255c27 linux evdev: Stop using the time field of input_event
Fixes github issue #104.

The time field is being removed from input_event (evdev) for 32bit
systems, to prepare for the year 2038 32bit timestamp rollover. This
breaks the build for spacenavd on 32bit linux systems.

Turns out that value was only ever used by the incorrect dominant axis
implementation which relied on timeouts (see github issue #84).
Therefore the easy fix for the missing time field is to just drop it
altogether and temporarilly disable the dominant axis code altogether
until it's fixed.
2024-06-02 05:37:54 +03:00
Rui Carmo 39856625a6 add ID for new Bluetooth variant of spacemouse wireless 2024-05-28 21:03:07 +03:00
Jaime van Kessel 3000236988 Add another version of keyboard pro to blacklist 2024-05-13 21:25:50 +03:00
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 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 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 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 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 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 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
John Tsiombikas 6aaf85f598 - fixed bug in AF_UNIX protocol request handling (both versions):
spacenavd would enter an infinite loop if at the time when a client
  disconnected, errno happened to be EINTR.
- allow axis mappings to be -1, to unmap a device axis.
2022-03-22 16:35:55 +02:00
John Tsiombikas 01e59bed7a - introduced explicit swap-yz config state, which acts separately to the
axis mapping. This way mappings won't swap around by themselves when
  swap is turned on or off.
- fixed automatic LED handling.
2022-03-22 12:29:36 +02:00
John Tsiombikas bea696f24f - client event mask (event type selection)
- added unique device ids (unique during spacenavd lifetime)
- send device change events
- added provision for configuration change events
2022-03-21 08:50:36 +02:00
John Tsiombikas 881feaed74 added reset request 2022-03-20 21:55:49 +02:00
John Tsiombikas 59b0be26f8 Change deadzone config to affect the device axes, not the output axes.
Makes much more sense like that.
2022-03-20 20:06:12 +02:00
John Tsiombikas b4dc387931 store and make available more information about the devices 2022-03-16 16:21:18 +02:00
John Tsiombikas cf397150a8 populate device name field for serial devices 2022-03-16 14:08:26 +02:00
John Tsiombikas 84c17ea404 written the new writecfg routine. untested until I also make something
that triggers it.
2022-03-13 14:42:22 +02:00
John Tsiombikas 3cfc60b80e preparing for the smarter config file writer 2022-03-12 10:09:37 +02:00
John Tsiombikas 8f062901b0 forgot to send status on REQ_CFG_RESTORE. also added logging if config
read fails and we fallback to restoring defaults.
2022-03-12 08:29:30 +02:00