Commit 4c79e98b authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: docs - update joystick documentation a bit

Consolidate use instructions and userspace API notes into the same chapter;
remove completely obsolete references, move into a separate subdirectory.
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 15e591a7
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
The Linux Input Documentation The Linux Input Documentation
============================= =============================
Core API Contents:
========
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
...@@ -12,8 +11,7 @@ Core API ...@@ -12,8 +11,7 @@ Core API
input input
input-programming input-programming
event-codes event-codes
joystick joydev/index
joystick-api
multi-touch-protocol multi-touch-protocol
gamepad gamepad
gameport-programming gameport-programming
......
.. include:: <isonum.txt>
======================
Linux Joystick support
======================
:Copyright: |copy| 1996-2000 Vojtech Pavlik <vojtech@ucw.cz> - Sponsored by SuSE
.. class:: toc-title
Table of Contents
.. toctree::
:maxdepth: 3
:numbered:
joystick
joystick-api
========================== =====================
Joystick API Documentation Programming Interface
========================== =====================
:Author: Ragnar Hojland Espinosa <ragnar@macula.net> - 7 Aug 1998 :Author: Ragnar Hojland Espinosa <ragnar@macula.net> - 7 Aug 1998
Introduction
============
.. important::
This document describes legacy ``js`` interface. Newer clients are
encouraged to switch to the generic event (``evdev``) interface.
The 1.0 driver uses a new, event based approach to the joystick driver.
Instead of the user program polling for the joystick values, the joystick
driver now reports only any changes of its state. See joystick-api.txt,
joystick.h and jstest.c included in the joystick package for more
information. The joystick device can be used in either blocking or
nonblocking mode, and supports select() calls.
For backward compatibility the old (v0.x) interface is still included.
Any call to the joystick driver using the old interface will return values
that are compatible to the old interface. This interface is still limited
to 2 axes, and applications using it usually decode only 2 buttons, although
the driver provides up to 32.
Initialization Initialization
============== ==============
Open the joystick device following the usual semantics (that is, with open). Open the joystick device following the usual semantics (that is, with open).
Since the driver now reports events instead of polling for changes, Since the driver now reports events instead of polling for changes,
immediately after the open it will issue a series of synthetic events immediately after the open it will issue a series of synthetic events
(JS_EVENT_INIT) that you can read to check the initial state of the (JS_EVENT_INIT) that you can read to obtain the initial state of the
joystick. joystick.
By default, the device is opened in blocking mode:: By default, the device is opened in blocking mode::
...@@ -182,7 +202,7 @@ the actual state of the joystick. ...@@ -182,7 +202,7 @@ the actual state of the joystick.
.. note:: .. note::
As for version 1.2.8, the queue is circular and able to hold 64 As of version 1.2.8, the queue is circular and able to hold 64
events. You can increment this size bumping up JS_BUFF_SIZE in events. You can increment this size bumping up JS_BUFF_SIZE in
joystick.h and recompiling the driver. joystick.h and recompiling the driver.
......
.. include:: <isonum.txt> .. include:: <isonum.txt>
============================ Introduction
Linux Joystick driver v2.0.0 ============
============================
:Copyright: |copy| 1996-2000 Vojtech Pavlik <vojtech@ucw.cz> - Sponsored by SuSE
Disclaimer
==========
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA
Should you need to contact me, the author, you can do so either by e-mail
- mail your message to <vojtech@ucw.cz>, or by paper mail: Vojtech Pavlik,
Simunkova 1594, Prague 8, 182 00 Czech Republic
For your convenience, the GNU General Public License version 2 is included
in the package: See the file COPYING.
Intro
=====
The joystick driver for Linux provides support for a variety of joysticks The joystick driver for Linux provides support for a variety of joysticks
and similar devices. It is based on a larger project aiming to support all and similar devices. It is based on a larger project aiming to support all
input devices in Linux. input devices in Linux.
Should you encounter any problems while using the driver, or joysticks The mailing list for the project is:
this driver can't make complete use of, I'm very interested in hearing about
them. Bug reports and success stories are also welcome.
The input project website is at:
http://atrey.karlin.mff.cuni.cz/~vojtech/input/
There is also a mailing list for the driver at:
listproc@atrey.karlin.mff.cuni.cz linux-input@vger.kernel.org
send "subscribe linux-joystick Your Name" to subscribe to it. send "subscribe linux-input" to majordomo@vger.kernel.org to subscribe to it.
Usage Usage
===== =====
...@@ -58,18 +19,22 @@ Usage ...@@ -58,18 +19,22 @@ Usage
For basic usage you just choose the right options in kernel config and For basic usage you just choose the right options in kernel config and
you should be set. you should be set.
inpututils Utilities
---------- ---------
For testing and other purposes (for example serial devices), a set of For testing and other purposes (for example serial devices), there is a set
utilities is available at the abovementioned website. I suggest you download of utilities, such as ``jstest``, ``jscal``, and ``evtest``,
and install it before going on. usually packaged as ``joystick``, ``input-utils``, ``evtest``, and so on.
``inputattach`` utility is required if your joystick is connected to a
serial port.
Device nodes Device nodes
------------ ------------
For applications to be able to use the joysticks, For applications to be able to use the joysticks, device nodes should be
you'll have to manually create these nodes in /dev:: created in /dev. Normally it is done automatically by the system, but
it can also be done by hand::
cd /dev cd /dev
rm js* rm js*
...@@ -166,7 +131,6 @@ And add a line to your rc script executing that file:: ...@@ -166,7 +131,6 @@ And add a line to your rc script executing that file::
This way, after the next reboot your joystick will remain calibrated. You This way, after the next reboot your joystick will remain calibrated. You
can also add the ``jscal -p`` line to your shutdown script. can also add the ``jscal -p`` line to your shutdown script.
HW specific driver information HW specific driver information
============================== ==============================
...@@ -467,6 +431,10 @@ future if I get an Amiga in the reach of my fingers. ...@@ -467,6 +431,10 @@ future if I get an Amiga in the reach of my fingers.
Game console and 8-bit pads and joysticks Game console and 8-bit pads and joysticks
----------------------------------------- -----------------------------------------
These pads and joysticks are not designed for PCs and other computers
Linux runs on, and usually require a special connector for attaching
them through a parallel port.
See :ref:`joystick-parport` for more info. See :ref:`joystick-parport` for more info.
SpaceTec/LabTec devices SpaceTec/LabTec devices
...@@ -613,19 +581,3 @@ FAQ ...@@ -613,19 +581,3 @@ FAQ
:Q: My joystick doesn't work with Quake / Quake 2. What's the cause? :Q: My joystick doesn't work with Quake / Quake 2. What's the cause?
:A: Quake / Quake 2 don't support joystick. Use joy2key to simulate keypresses :A: Quake / Quake 2 don't support joystick. Use joy2key to simulate keypresses
for them. for them.
Programming Interface
=====================
The 1.0 driver uses a new, event based approach to the joystick driver.
Instead of the user program polling for the joystick values, the joystick
driver now reports only any changes of its state. See joystick-api.txt,
joystick.h and jstest.c included in the joystick package for more
information. The joystick device can be used in either blocking or
nonblocking mode and supports select() calls.
For backward compatibility the old (v0.x) interface is still included.
Any call to the joystick driver using the old interface will return values
that are compatible to the old interface. This interface is still limited
to 2 axes, and applications using it usually decode only 2 buttons, although
the driver provides up to 32.
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
.. _joystick-parport: .. _joystick-parport:
=================================== ==============================
Linux Joystick parport drivers v2.0 Parallel port Joystick Drivers
=================================== ==============================
:Copyright: |copy| 1998-2000 Vojtech Pavlik <vojtech@ucw.cz> :Copyright: |copy| 1998-2000 Vojtech Pavlik <vojtech@ucw.cz>
:Copyright: |copy| 1998 Andree Borrmann <a.borrmann@tu-bs.de> :Copyright: |copy| 1998 Andree Borrmann <a.borrmann@tu-bs.de>
...@@ -20,8 +20,8 @@ it will be true. So, use it at your own risk. The possible damages that can ...@@ -20,8 +20,8 @@ it will be true. So, use it at your own risk. The possible damages that can
happen include burning your parallel port, and/or the sticks and joystick happen include burning your parallel port, and/or the sticks and joystick
and maybe even more. Like when a lightning kills you it is not our problem. and maybe even more. Like when a lightning kills you it is not our problem.
Intro Introduction
===== ============
The joystick parport drivers are used for joysticks and gamepads not The joystick parport drivers are used for joysticks and gamepads not
originally designed for PCs and other computers Linux runs on. Because of originally designed for PCs and other computers Linux runs on. Because of
...@@ -582,7 +582,7 @@ use turbografx.map2 and turbografx.map3 as additional command line parameters ...@@ -582,7 +582,7 @@ use turbografx.map2 and turbografx.map3 as additional command line parameters
for two more interfaces. for two more interfaces.
PC parallel port pinout PC parallel port pinout
----------------------- =======================
:: ::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment