Prior to this change, the x52d virtual mouse logic was assuming that the
joystick would only send one report with the wheel button state as "on",
and subsequent reports would be "off". However, with some joysticks, the
other axis sensors could be faulty or noisy, and the joystick could send
multiple reports with the mouse button "on", without an "off" state in
between. This was causing scroll events to be much faster than would be
expected (1 mouse scroll to 1 screen scroll event)
This change should fix the problem, by comparing the value of the
previous button state. This should now trigger a wheel event only on a
rising edge (from "off" to "on").
See #46
This change adds a ReverseScroll parameter to the configuration, which
if set, will change the direction of the scroll wheel of the virtual
mouse.
Github-Issue: #45
Prior to this change, the IO thread would always report a mouse button
event, even if the mouse was disabled in configuration, or the uinput
device was not created. This results in unexpected button/wheel events.
This change checks that the uinput device has been created and the mouse
has been enabled in the configuration before reporting a button or wheel
event.
Prior to this change, the virtual mouse update was restricted to
updating once every `mouse_delay` microseconds, and the allowed values
were a small fixed set. Some users reported that even at the highest
speed, the speed was slower than they were used to (with a high DPI
mouse).
This change modifies the speed calculation algorithm as follows. It
keeps the slowest speed to refresh the mouse every 70 ms. As the speed
increases, the refresh rate drops by 5 ms for every increment in speed,
until the refresh rate caps at once every 10 ms. Beyond that, a
multiplicative factor begins to take effect, with each speed increase
adding 0.25 to the factor. That is, speed 13 would multiply the axis
components by 1.25 _and_ refresh every 10 ms. Speed 14 would bump the
factor to 1.50, speed 15 to 1.75, and so on, until the factor tops out
at 6.0.
Prior to this change, the button change events were only happening on
periodic intervals corresponding to the change in the mouse REL_X and
REL_Y values. However, this has the issue that it tends to miss a few
events, especially those related to the scroll wheel.
This change reports button and wheel events immediately when receiving
the report, but it leaves the motion to be updated by the thread.
Prior to this change, the build would fail on macOS systems because the
evdev sources were only included on Linux systems, and macOS does not
have evdev/libevdev. By separating out the configuration and update
threads, this should build on macOS, but the configuration would be
ignored.
This change adds the configuration and build related changes for
supporting the virtual mouse. Subsequent commits will add support for
reading the IO interface and translating it to mouse commands.