xf86-input-joystick: Changes to 'master'
Sascha Hlusiak
saschahlusiak at kemper.freedesktop.org
Wed Jan 16 01:51:36 PST 2013
src/backend_evdev.c | 26 +++++++++++++++++++++--
src/jstk_axis.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 79 insertions(+), 4 deletions(-)
New commits:
commit 819ba33c9d7440cd40e1e54a9b1e073ed89353a7
Author: Sascha Hlusiak <saschahlusiak at arcor.de>
Date: Sat Oct 6 18:28:53 2012 +0200
jast_axis: tune accelerated axis transformation to better work with circular axis fields
reference: https://bugs.freedesktop.org/show_bug.cgi?id=42399
joysticks with a rectangular field have a
corner position of (32768,32768), joysticks with a
circular field have (23170,23170).
make sure that diagonal movement feels fast. either:
1) linear
f(32768) ~= f(23170) + f(23170)
f(32768) ~= a * f(23170)
a = 2.0
on circular joysticks, the time needed for xy movement is
exactly the time needed for x + the time for y separately.
absolute diagonal travel speed (in cm/s) is 0.707 times as fast,
which feels pretty slow.
on square joysticks, diagonal travel speed is always 1.41 times
faster than orthogonal travel speed. time needed for diagonal
movement is always 0.5 times as long as for orthogonal movement.
the value of a = 2.0 results in a nice, non-linear acceleration.
or
2) trigonometric
f(32768) ~= sqrt(f(23170)^2 + f(23170)^2))
f(32768) ~= a * f(23170)
a = 1.414
on circular joysticks, the absolute pointer travel speed
(in cm/s) is now the same for both linear and diagonal movement,
which feels natural. moving diagonally takes 0.707 times the time
of moving orthogonally.
on square joysticks, values are as in 1)
the value of a = 1.414 results in linear acceleration, which feels
too slow.
to maintain non-linear acceleration, make sure that:
a >>= 1.414
the following formula achieves results inbetween,
so it should feel natural on both devices while maintaining a
nice acceleration:
f(32768) ~= 1.620 * f(23170)
commit 342057bf38e2da46609ed2fa0d3f5fb46c8ed215
Author: Sascha Hlusiak <saschahlusiak at arcor.de>
Date: Sat Oct 6 16:18:24 2012 +0200
backend_evdev: fix scaling overflow for high resolution axes
The module scales all axis values from the kernel to the range of
-32768 .. 32768, for compatibility with the old joystick kernel module.
The current implementation had an integer overflow, if the axis had a high
resolution of > 16384, like the popular XBox 360 controller.
This commitmakes the scaling use float instead to fix erratic behaviour
on high resolution joysticks. The joystick backend was not affected.
Fixes bug: https://bugs.freedesktop.org/show_bug.cgi?id=42399
More information about the xorg-commit
mailing list