Wykres commitów

257 Commity (master)

Autor SHA1 Wiadomość Data
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
John Tsiombikas 2d0db49d0f - implemented save/restore cfg protocol handling.
- made SIGHUP handling safer, by moving the cfg re-read into the select
  loop, and triggering it with a self-pipe write.
2022-03-12 08:20:08 +02:00
John Tsiombikas 4505d67bb7 fixed missing cfg protocol handlers (led, grab) 2022-03-01 01:34:12 +02:00
John Tsiombikas 04a883da90 fixed bug in new protocol handlers 2022-02-28 23:47:19 +02:00
John Tsiombikas 4ec6e2abcb more additions to the new protocol 2022-02-13 02:32:40 +02:00
John Tsiombikas 8f09c30e2d protocol v1: more cfg options 2022-02-12 19:12:22 +02:00
John Tsiombikas caaf31d759 handle client dropping out in protocol v1 2022-02-12 17:24:57 +02:00
John Tsiombikas 62cb5389c4 fixed protocol v1 handling bugs 2022-02-12 16:47:09 +02:00
John Tsiombikas 7145788c5e started working on the spacenavd protocol v1 2022-02-10 12:58:33 +02:00
John Tsiombikas 946a0874d2 removed the global disable-translation/disable-rotation options, and
moved the state variables out of the cfg structure.
2022-02-10 07:05:56 +02:00
John Tsiombikas 6e458f1676 Merge branch 'bnev_dis_motion' 2022-02-10 06:49:30 +02:00
Alberto Fanjul 4f7989d04b Actions for buttons to enable/disable rotation/translation 2022-02-09 20:43:24 +01:00
John Tsiombikas eb0287f6e8
Merge pull request #57 from luzpaz/typos
Fix trivial source comment typos
2022-02-06 05:00:19 +02:00
luz paz bf0ea1ecf9 Fix trivial source comment typos
Found via `codespell -q 3 -L mot`
2022-02-05 10:22:09 -05:00
John Tsiombikas ab4751c4ea
Merge pull request #55 from RealDeuce/fix-index-type
Use size_t when iterating gl_pathc
2022-01-29 20:56:35 +02:00
John Tsiombikas 7689859318
Merge pull request #54 from RealDeuce/unused-header
Remove unused header
2022-01-29 20:55:40 +02:00
Stephen Hurd 07d8a39075 Use size_t when iterating gl_pathc
Since gl_pathc is a size_t, the size and signedness is likely to
be different than int.
2022-01-29 13:43:03 -05:00
Stephen Hurd 816335c963 Remove unused header 2022-01-29 13:40:01 -05:00
John Tsiombikas e2c809ee36 configure: added --cfgdir= option to change the default config file path 2022-01-29 11:40:33 +02:00
John Tsiombikas 58bc16dd0c minor C89-compliance and code style fixes in dev_usb_freebsd.c 2022-01-29 08:41:49 +02:00
John Tsiombikas 9f0870ed51 Merge branch 'freebsdusb' 2022-01-29 08:21:46 +02:00
Stephen Hurd 9c5976d41c Merge branch 'master' into freebsd-port 2022-01-29 01:05:22 -05:00
Stephen Hurd 02a9806b9d Open uhid device non-blocking
The main loop is driven by the read function returning -1.  If we
always return 0, processing gets stuck.
2022-01-29 00:54:24 -05:00
John Tsiombikas d56c0e502c
Merge pull request #53 from RealDeuce/fix-no-x11-warning
Add warning suppression when --disable-x11 is used
2022-01-29 07:53:59 +02:00
John Tsiombikas 2a86295910
Merge pull request #52 from RealDeuce/silence_xtest_warning
Declare use_xtest in #ifdef HAVE_XTEST_H
2022-01-29 07:51:40 +02:00
Stephen Hurd 4cc34b78fe Return event for every message
Previously, translation and rotation events were only returned when
the axis value changed.  This causes issues when the space mouse is
held still in a movment position.

Now, every message received via USB is translated to events for the
daemon to handle.
2022-01-28 23:35:02 -05:00
Stephen Hurd 8d3ab7e514 Add warning suppression when --disable-x11 is used 2022-01-28 14:03:34 -05:00
Stephen Hurd d0469c5fb6 Add -I/usr/local/include to cpp flags
On FreeBSD, X11 headers are in /usr/local/include/X11, not
/usr/include/X11.  since -I/usr/local/include is added to CFLAGS
in Makefile.in, the test should also include that.

This allows FreeBSD to properly test XInput2 and XTest headers.
2022-01-28 13:56:34 -05:00
Stephen Hurd 8cdfa0c282 Fix some glaring style inconsistences. 2022-01-28 13:32:30 -05:00
Stephen Hurd 1b3d9770fe Fix warning silencing declaration name 2022-01-28 13:28:34 -05:00
Stephen Hurd 5f91c9c107 Declare use_xtest in #ifdef HAVE_XTEST_H
Prevents harmless unused variable warning.
2022-01-28 13:27:05 -05:00
Stephen Hurd f94c344a75 Silent warning for hotplug as well. 2022-01-28 13:26:24 -05:00
Stephen Hurd e4d1cdfd15 Change warning silencer hack to more appropriate name 2022-01-28 13:24:20 -05:00
Stephen Hurd 1b5cd4538a Add missing globfree() call 2022-01-28 13:23:30 -05:00
Stephen Hurd 794a6b8e1a Remove unused #defines 2022-01-28 13:19:26 -05:00
Stephen Hurd 4fd3dc3c13 Remove change missed during rebase 2022-01-28 13:18:17 -05:00