Blame README

Packit e652c1
			  linuxconsole tools
Packit e652c1
			    Release 1.5.1
Packit e652c1
		 http://sf.net/projects/linuxconsole/
Packit e652c1
Packit e652c1
Packit e652c1
This package contains the following utilities and associated
Packit e652c1
documentation:
Packit e652c1
* inputattach - connects legacy serial devices to the input layer
Packit e652c1
* joystick utilities - calibrate and test joysticks and joypads
Packit e652c1
Packit e652c1
The evtest tool, which used to be part of this package, is now
Packit e652c1
maintained separately at http://cgit.freedesktop.org/evtest/ and
Packit e652c1
https://bugzilla.freedesktop.org/enter_bug.cgi?product=evtest
Packit e652c1
Packit e652c1
Packit e652c1
Joystick utilities
Packit e652c1
------------------
Packit e652c1
Packit e652c1
The following utilities are provided to calibrate and test joysticks:
Packit e652c1
* evdev-joystick - calibrate joystick devices (including dead zones
Packit e652c1
  and fuzz)
Packit e652c1
* ffcfstress, ffmvforce, fftest - test force-feedback devices
Packit e652c1
* ffset - set force-feedback device parameters
Packit e652c1
* jscal - calibrate joystick devices, reconfigure the axes and buttons
Packit e652c1
* jscal-store, jscal-restore - store and retrieve joystick device
Packit e652c1
  settings as configured using jscal
Packit e652c1
* jstest - test joystick devices
Packit e652c1
Packit e652c1
The typical scenario when configuring a new device is as follows:
Packit e652c1
1. Check the basic functions using jstest (number of buttons, axes,
Packit e652c1
   etc.).
Packit e652c1
2. Calibrate the joystick using jscal (this can be useful even if the
Packit e652c1
   device functions correctly, if only to configure the dead-zone at
Packit e652c1
   the centre).
Packit e652c1
3. Repeat steps 1 and 2 until the joystick is configured to the user's
Packit e652c1
   satisfaction.
Packit e652c1
4. Store the device's setup using jscal-store.
Packit e652c1
Packit e652c1
Packit e652c1
Installation
Packit e652c1
------------
Packit e652c1
Packit e652c1
Most of the utilities have no particular requirement beyond a libc and
Packit e652c1
the Linux input layer headers (normally part of your libc
Packit e652c1
installation). ffmvforce requires SDL (libsdl1.2-dev on Debian
Packit e652c1
derivatives).
Packit e652c1
Packit e652c1
To install the utilities and their manpages, run
Packit e652c1
	make
Packit e652c1
or
Packit e652c1
	make SYSTEMD_SUPPORT=1
Packit e652c1
and then as root
Packit e652c1
	make install
Packit e652c1
from the distribution's top directory. This will install everything
Packit e652c1
into /usr/local. Should you wish to install the tools elsewhere, you
Packit e652c1
can use the PREFIX variable:
Packit e652c1
	PREFIX=/usr make install
Packit e652c1
The Makefiles also recognise the DESTDIR variable which can be used to
Packit e652c1
install into a temporary directory (this is useful mainly for
Packit e652c1
distribution packagers).
Packit e652c1
Packit e652c1
Packit e652c1
Auto-loading inputattach and jscal-restore
Packit e652c1
------------------------------------------
Packit e652c1
Packit e652c1
udev can be used to start inputattach and jscal-restore when the
Packit e652c1
appropriate device is connected to the system (or detected when the
Packit e652c1
system is booting up).
Packit e652c1
Packit e652c1
The following rule restores the stored calibration and axis/button
Packit e652c1
mappings whenever a joystick device is connected:
Packit e652c1
	KERNEL=="js*", ACTION=="add", RUN+="/usr/bin/jscal-restore %E{DEVNAME}"
Packit e652c1
(change the path as appropriate). This rule needs /usr to be
Packit e652c1
available, which can cause issues on systems where udev is run from
Packit e652c1
the initramfs or where /usr is a separate partition. To work around
Packit e652c1
this, the Debian package uses a script provided by Debian's udev
Packit e652c1
package to wait for jscal-restore to become available. Should you wish
Packit e652c1
to reproduce this, you need to create a udev agent
Packit e652c1
(/lib/udev/jscal-restore) containing the following:
Packit e652c1
Packit e652c1
#!/bin/sh -e
Packit e652c1
# udev agent for jscal-restore
Packit e652c1
Packit e652c1
wait_for_file() {
Packit e652c1
	local file=$1
Packit e652c1
	local count=120
Packit e652c1
	while [ $count != 0 ]; do
Packit e652c1
		[ -e "$file" ] && return 0
Packit e652c1
		sleep 1
Packit e652c1
		count=$(($count - 1))
Packit e652c1
	done
Packit e652c1
	exit 1
Packit e652c1
}
Packit e652c1
Packit e652c1
(
Packit e652c1
	wait_for_file /usr/bin/jscal-restore
Packit e652c1
	exec /usr/bin/jscal-restore $1
Packit e652c1
) &
Packit e652c1
Packit e652c1
and change the udev rule to
Packit e652c1
	KERNEL=="js*", ACTION=="add", RUN+="/lib/udev/jscal-restore %E{DEVNAME}"
Packit e652c1
Packit e652c1
The following rule forces flaky Acrux gamepads to stay awake:
Packit e652c1
	KERNEL=="js*", ACTION=="add", ATTRS{name}=="ACRUX USB GAMEPAD 8116", RUN+="/bin/sleep 5000 < /dev/%k"
Packit e652c1
(This should only be necessary on kernels older than 2.6.39-rc1.)
Packit e652c1
Packit e652c1
The following rule configures a Mouse Systems mouse on the first
Packit e652c1
serial port:
Packit e652c1
	KERNEL=="ttyS0", ACTION=="add", RUN+="/usr/bin/inputattach --daemon -msc /dev/%k"
Packit e652c1
If you need to wait for /usr you can adapt the recipe above.
Packit e652c1
Packit e652c1
The following rules configures a Wacom W8001 devices on a Fujitsu
Packit e652c1
T2010[2] or on Lenovo X200-series laptops and tablets:
Packit e652c1
	SUBSYSTEM=="tty", KERNEL=="ttyS[0-9]*", ATTRS{id}=="FUJ02e5", ACTION=="add|change", RUN+="/usr/bin/inputattach --daemon --baud 19200 --w8001 /dev/%k"
Packit e652c1
	SUBSYSTEM=="tty", KERNEL=="ttyS[0-9]*", ATTRS{id}=="WACf00c", ACTION=="add|change", RUN+="/usr/bin/inputattach --daemon --baud 38400 --w8001 /dev/%k"
Packit e652c1
Packit e652c1
These rules are liable to cause conflicts with the X.org wacom
Packit e652c1
driver. For example, on some Debian-based systems the
Packit e652c1
/usr/share/X11/xorg.conf.d/50-wacom.conf configuration file needs to
Packit e652c1
be amended so that the "MatchProduct" line matching one of the
Packit e652c1
identifiers used above ("FUJ02e5" or "WACf00c", the latter being
Packit e652c1
matched by "WACf") no longer contains the matching identifier. The
Packit e652c1
appropriate X.org driver when using inputattach in this way is evdev.
Packit e652c1
Packit e652c1
A udev rule, especially shipped in a custom OS package is not
Packit e652c1
always applicable because it cannot handle the conflict presented
Packit e652c1
by the fact that not all computers are built the same and on one
Packit e652c1
computer, e.g ttyS1 can be attached to a specific touchscreen,
Packit e652c1
in another computer it can be attached to a different kind of
Packit e652c1
touchscreen or a different device or connected at all.
Packit e652c1
For this case, a wrapper script started from sysvinit, upstart, or
Packit e652c1
systemd is better suited. systemd needs special treatment inside
Packit e652c1
inputattach: a notification must be sent to it when inputattach
Packit e652c1
becomes "ready". To achieve this, the previously mentioned
Packit e652c1
"make SYSTEMD_SUPPORT=1" must be used to include this support.
Packit e652c1
Then a systemd unit file and the wrapper script can be added, similar
Packit e652c1
to the following:
Packit e652c1
Packit e652c1
----8<---- inputattach-wrapper.sh ----8<----
Packit e652c1
#!/bin/sh
Packit e652c1
Packit e652c1
SYSTEM=`detect_computer_type`
Packit e652c1
case $SYSTEM in
Packit e652c1
type1)
Packit e652c1
    inputattach --daemon -pm9k /dev/ttyS2
Packit e652c1
    ;;
Packit e652c1
type2)
Packit e652c1
    inputattach --daemon -mtouch /dev/ttyS2
Packit e652c1
    ;;
Packit e652c1
# and so on
Packit e652c1
*)
Packit e652c1
    # do nothing for other computers
Packit e652c1
    ;;
Packit e652c1
esac
Packit e652c1
Packit e652c1
# Exit without errors, so systemd won't try to
Packit e652c1
# restart our script for the "do nothing" case.
Packit e652c1
exit 0
Packit e652c1
----8<- end of inputattach-wrapper.sh-8<----
Packit e652c1
Packit e652c1
----8<---- inputattach.service    ----8<----
Packit e652c1
[Unit]
Packit e652c1
Description=inputattach helper service
Packit e652c1
Packit e652c1
[Service]
Packit e652c1
Type=forking
Packit e652c1
NotifyAccess=all
Packit e652c1
ExecStart=/usr/sbin/inputattach-wrapper.sh
Packit e652c1
Packit e652c1
[Install]
Packit e652c1
WantedBy=multi-user.target
Packit e652c1
----8<- end of inputattach.service----8<----
Packit e652c1
Packit e652c1
Configuring PS3 controller LEDs
Packit e652c1
-------------------------------
Packit e652c1
Packit e652c1
The js-set-enum-leds can be used with udev to ensure that the
Packit e652c1
controller LEDs on PS3 controllers match their identifiers as set by
Packit e652c1
Bluetooth host software. This ensures that if the controllers are
Packit e652c1
plugged in before the Bluetooth daemon starts, the LEDs still match
Packit e652c1
the identifier assigned once the daemon has initialised.
Packit e652c1
Packit e652c1
The following udev rule achieves this:
Packit e652c1
Packit e652c1
	# Set PS3 controller leds to the same value bluez will choose for it.
Packit e652c1
	# IMPORT{parent} used because $parent did not appear to be working; we
Packit e652c1
	# don't need the devpath of the js device for this so it is OK to overwrite.
Packit e652c1
	ACTION=="add", KERNEL=="js*", IMPORT{parent}="DEVPATH", ATTRS{name}=="Sony PLAYSTATION(R)3 Controller", RUN+="/lib/udev/js-set-enum-leds /sys/%E{DEVPATH}/device/leds/ $number"
Packit e652c1
Packit e652c1
Packit e652c1
Contributors
Packit e652c1
------------
Packit e652c1
Packit e652c1
The following people have contributed to this release:
Packit e652c1
* Johann Walles: jscal jitter tolerance.
Packit e652c1
* Dr. László Kaján: button and axis remapping.
Packit e652c1
* Sebastian Siewior: EVIOCGBIT correction.
Packit e652c1
* Krzysztof A. Sobiecki: improvements to the button and axis remapping
Packit e652c1
  functions.
Packit e652c1
* Claudio Nieder: Sahara Touch-iT213 support.
Packit e652c1
* Florian Fainelli: evtest fixes.
Packit e652c1
* Alexander Clouter: W8001 support and error-handling fixes.
Packit e652c1
* Roberto Neri: much discussion, and fixes and improvements to
Packit e652c1
  jscal-store/jscal-restore and the udev rules given above.
Packit e652c1
* Jean Delvare: inputattach improvements, TAOS support.
Packit e652c1
* Brian Murray and Kees Cook: Lenovo W8001 support.
Packit e652c1
* Raoul Bönish: fixes for the udev rules.
Packit e652c1
* John Sung: PenMount 3000, 6000 and 6250 support.
Packit e652c1
* Christian Gmeiner: TSC-40 support.
Packit e652c1
* Kyle Manna: various build fixes.
Packit e652c1
* Denis Gonsiorovsky: Genius EasyPen 3x4 tablet support.
Packit e652c1
* Jaromir Capik: 64-bit fixes and changes from ff-utils (based on a
Packit e652c1
  patch originally by Jean-Philippe Meure).
Packit e652c1
* Ralf Jung: fixes for long device names.
Packit e652c1
* Andrew Basterfield: fix for Spaceball 4000FLX support.
Packit e652c1
* bri: PS3 controller LED configuration
Packit e652c1
* Julian Squires: Wacom IV support.
Packit e652c1
* Jamie Lentin: mouseman4 mode.
Packit e652c1
* Böszörményi Zoltán: eGalaxTouch support, Hampshire support, systemd
Packit e652c1
  notification.
Packit e652c1
* Stephen Anthony: evdev-joystick (based on G25manage).
Packit e652c1
* Hans Verkuil: Pulse-Eight HDMI CEC dongle support.
Packit e652c1
* Jon Sangster: min/max axis control in evdev-joystick.
Packit e652c1
Packit e652c1
Packit e652c1
License
Packit e652c1
-------
Packit e652c1
Packit e652c1
The linuxconsole tools are
Packit e652c1
	Copyright © 1996-2005 Vojtech Pavlik
Packit e652c1
	Copyright © 2001 Oliver Hamann
Packit e652c1
	Copyright © 2001-2002 Johann Deneux
Packit e652c1
	Copyright © 2001 Arndt Schoenewald
Packit e652c1
	Copyright © 2008-2016 Stephen Kitt
Packit e652c1
	Copyright © 2016 Stephen Anthony
Packit e652c1
Packit e652c1
Packit e652c1
This program is free software; you can redistribute it and/or modify
Packit e652c1
it under the terms of the GNU General Public License as published by
Packit e652c1
the Free Software Foundation; either version 2 of the License, or (at
Packit e652c1
your option) any later version.
Packit e652c1
Packit e652c1
This program is distributed in the hope that it will be useful, but
Packit e652c1
WITHOUT ANY WARRANTY; without even the implied warranty of
Packit e652c1
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Packit e652c1
General Public License for more details.
Packit e652c1
Packit e652c1
You should have received a copy of the GNU General Public License
Packit e652c1
along with this program; if not, write to the Free Software
Packit e652c1
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
Packit e652c1
USA.
Packit e652c1
Packit e652c1
Packit e652c1
The GNU General Public License version 2 is provided in the COPYING
Packit e652c1
file.