Open zacharyburnett opened 1 year ago
I think the reason that your mouse is not getting detected as a joystick is because most joysticks use EV_ABS events, whereas your mouse is emitting EV_REL events. On the latest stable evsieve, you could try using
evsieve --input /dev/input/by-id/usb-3Dconnexion_SpaceNavigator-event-if00 \
--map rel:x abs:x \
--map rel:y abs:y \
--map rel:z abs:z \
--map rel:rx abs:rx \
--map rel:ry abs:ry \
--map rel:rz abs:rz \
--output abs create-link=/dev/input/js0
... but you will probably run into issues because this results in the possible output values being theoretically unbounded (and with 32-bit integer limitations, bounded by [-2147483648, 2147483647]). Since I suppose much software will determine how far the joystick has been moved by comparing its current value to the range of the axes, a value of 30 will probably be treated as a negligible movement.
To fix this on the latest stable version, I suppose you could try to multiply the movement by a big value?
evsieve --input /dev/input/by-id/usb-3Dconnexion_SpaceNavigator-event-if00 \
--map rel:x abs:x \
--map rel:y abs:y \
--map rel:z abs:z \
--map rel:rx abs:rx \
--map rel:ry abs:ry \
--map rel:rz abs:rz \
`Multiply the value of all EV_ABS events by 30000000.` \
--map abs ::30000000x \
--output abs create-link=/dev/input/js0
For a more sensible solution to this problem, I made it possible on the development main branch to specify a range of values for output keys, to clip the axes within a certain range of values, e.g.
evsieve --input /dev/input/by-id/usb-3Dconnexion_SpaceNavigator-event-if00 \
--map rel:x abs:x:-64~64 \
--map rel:y abs:y:-64~64 \
--map rel:z abs:z:-64~64 \
--map rel:rx abs:rx:-64~64 \
--map rel:ry abs:ry:-64~64 \
--map rel:rz abs:rz:-64~64 \
--output abs create-link=/dev/input/js0
will clip the values for all EV_ABS events in the range [-64, 64]. Depending on the range of what your mouse output, another range may be more suitable.
(The reason this is not possible on the stable version yet is because I wasn't sure whether I wanted to use ranges on output events for clipping or for scaling, so I had left unimplemented. By now, we already have another way to scale events but no way to clip them, so I suppose it makes sense to use ranges on output events for clipping.)
The above is based on the assumption that your mouse uses EV_REL events to report absolute values, which seems the most likely way based on what the mouse looks like. If I am wrong and the above does not work properly because it uses EV_REL events to report actually relative values, then check out the new --rel-to-abs
argument that I just implemented on the main branch for issue #33.)
wow, installing evsieve-git
and then using your third example with [-350, 350]
worked perfectly!
Thanks for your help!
Hello! I have a spacenavigator 6dof mouse, and am trying to convert its events to a joystick output. It currently resides at
/dev/input/event3
.evtest
shows relative events:Additionally, I can run
evsieve
with the following arguments:and then read
/dev/input/js0
withevtest
to get the same relative events as before.However, this is obviously just passing the raw events and not outputting a proper joystick / controller format; KDE's fancy Game Controller page tells me this:![image](https://github.com/KarsMulder/evsieve/assets/16024299/7e763ac7-f2fb-4dc3-8f23-80a848aa79a9)
I apologize if this is trivial, but after going through the README I am still confused on how to actually make joystick output with
evsieve
. What mappings should I be using? Should these be absolute events instead?Thanks!