⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 joystick.txt

📁 ARM 嵌入式 系统 设计与实例开发 实验教材 二源码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
		       Linux Joystick driver v2.0.0	       (c) 1996-2000 Vojtech Pavlik <vojtech@suse.cz>			     Sponsored by SuSE	   $Id: joystick.txt,v 1.6 2001/06/05 09:57:01 vojtech Exp $----------------------------------------------------------------------------0. Disclaimer~~~~~~~~~~~~~  This program is free software; you can redistribute it and/or modify itunder the terms of the GNU General Public License as published by the FreeSoftware 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, butWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITYor FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License formore details.  You should have received a copy of the GNU General Public License alongwith this program; if not, write to the Free Software Foundation, Inc., 59Temple 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@suse.cz>, or by paper mail: Vojtech Pavlik,Ucitelska 1576, Prague 8, 182 00 Czech Republic  For your convenience, the GNU General Public License version 2 is includedin the package: See the file COPYING.1. Intro~~~~~~~~  The joystick driver for Linux provides support for a variety of joysticksand similar devices. It is based on a larger project aiming to support allinput devices in Linux.  Should you encounter any problems while using the driver, or joysticksthis driver can't make complete use of, I'm very interested in hearing aboutthem. Bug reports and success stories are also welcome.  The input project website is at:	http://www.suse.cz/development/input/	http://atrey.karlin.mff.cuni.cz/~vojtech/input/  There is also a mailing list for the driver at:	listproc@atrey.karlin.mff.cuni.czsend "subscribe linux-joystick Your Name" to subscribe to it.2. Usage~~~~~~~~  For basic usage you just choose the right options in kernel config andyou should be set.2.1 inpututils~~~~~~~~~~~~~~For testing and other purposes (for example serial devices), a set ofutilities is available at the abovementioned website. I suggest you downloadand install it before going on.2.2 Device nodes~~~~~~~~~~~~~~~~For applications to be able to use the joysticks, in you don't use devfs,you'll have to manually create these nodes in /dev:cd /devrm js*mkdir inputmknod input/js0 c 13 0mknod input/js1 c 13 1mknod input/js2 c 13 2mknod input/js3 c 13 3ln -s input/js0 js0ln -s input/js1 js1ln -s input/js2 js2ln -s input/js3 js3For testing with inpututils it's also convenient to create these:mknod input/event0 c 13 64mknod input/event1 c 13 65mknod input/event2 c 13 66mknod input/event3 c 13 672.4 Modules needed ~~~~~~~~~~~~~~~~~~  For all joystick drivers to function, you'll need the userland interfacemodule in kernel, either loaded or compiled in:	modprobe joydev  For gameport joysticks, you'll have to load the gameport driver as well;	modprobe ns558  And for serial port joysticks, you'll need the serial input linediscipline module loaded and the inputattach utility started:	modprobe serport	inputattach -xxx /dev/tts/X &  In addition to that, you'll need the joystick driver module itself, mostusually you'll have an analog joystick:	modprobe analog	  For automatic module loading, something like this might work - tailor toyour needs:	alias tty-ldisc-2 serport	alias char-major-13 input	above input joydev ns558 analog	options analog js=gameport2.5 Verifying that it works~~~~~~~~~~~~~~~~~~~~~~~~~~~  For testing the joystick driver functionality, there is the jstestprogram in the utilities package. You run it by typing:	jstest /dev/js0  And it should show a line with the joystick values, which update as youmove the stick, and press its buttons. The axes should all be zero when thejoystick is in the center position. They should not jitter by themselves toother close values, and they also should be steady in any other position ofthe stick. They should have the full range from -32767 to 32767. If all thisis met, then it's all fine, and you can play the games. :)  If it's not, then there might be a problem. Try to calibrate the joystick,and if it still doesn't work, read the drivers section of this file, thetroubleshooting section, and the FAQ.2.6. Calibration~~~~~~~~~~~~~~~~  For most joysticks you won't need any manual calibration, since thejoystick should be autocalibrated by the driver automagically. However, withsome analog joysticks, that either do not use linear resistors, or if youwant better precision, you can use the jscal program	jscal -c /dev/js0 included in the joystick package to set better correction coefficients thanwhat the driver would choose itself.  After calibrating the joystick you can verify if you like the newcalibration using the jstest command, and if you do, you then can save thecorrection coefficients into a file	jscal -p /dev/js0 > /etc/joystick.cal  And add a line to your rc script executing that file	source /etc/joystick.cal  This way, after the next reboot your joystick will remain calibrated. Youcan also add the jscal -p line to your shutdown script.3. HW specific driver information~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In this section each of the separate hardware specific drivers is described.3.1 Analog joysticks~~~~~~~~~~~~~~~~~~~~  The analog.c uses the standard analog inputs of the gameport, and thussupports all standard joysticks and gamepads. It uses a very advancedroutine for this, allowing for data precision that can't be found on anyother system.  It also supports extensions like additional hats and buttons compatiblewith CH Flightstick Pro, ThrustMaster FCS or 6 and 8 button gamepads. SaitekCyborg 'digital' joysticks are also supported by this driver, becausethey're basically souped up CHF sticks.  However the only types that can be autodetected are:* 2-axis, 4-button joystick* 3-axis, 4-button joystick* 4-axis, 4-button joystick* Saitek Cyborg 'digital' joysticks  For other joystick types (more/less axes, hats, and buttons) supportyou'll need to specify the types either on the kernel command line or on themodule command line, when inserting analog.o into the kernel. Theparameters are:	js=type,type,type,....  'type' is type of the joystick from the table below, defining joystickspresent on gameports in the system, starting with gameport0, second 'type'entry defining joystick on gameport1 and so on.	Type     | Meaning	-----------------------------------	none     | No analog joystick on that port	auto     | Autodetect joystick	2btn     | 2-button n-axis joystick	y-joy    | Two 2-button 2-axis joysticks on an Y-cable	y-pad    | Two 2-button 2-axis gamepads on an Y-cable	fcs      | Thrustmaster FCS compatible joystick	chf      | Joystick with a CH Flightstick compatible hat	fullchf  | CH Flightstick compatible with two hats and 6 buttons	gamepad  | 4/6-button n-axis gamepad	gamepad8 | 8-button 2-axis gamepad  In case your joystick doesn't fit in any of the above categories, you canspecify the type as a number by combining the bits in the table below. Thisis not recommended unless you really know what are you doing. It's notdangerous, but not simple either.	Bit | Meaning	--------------------------	 0  | Axis X1	 1  | Axis Y1	 2  | Axis X2	 3  | Axis Y2	 4  | Button A	 5  | Button B	 6  | Button C	 7  | Button D	 8  | CHF Buttons X and Y	 9  | CHF Hat 1	10  | CHF Hat 2	11  | FCS Hat	12  | Pad Button X	13  | Pad Button Y	14  | Pad Button U	15  | Pad Button V	16  | Saitek F1-F4 Buttons	17  | Saitek Digital Mode	19  | GamePad	20  | Joy2 Axis X1	21  | Joy2 Axis Y1	22  | Joy2 Axis X2	23  | Joy2 Axis Y2	24  | Joy2 Button A	25  | Joy2 Button B	26  | Joy2 Button C	27  | Joy2 Button D	31  | Joy2 GamePad3.2 Microsoft SideWinder joysticks~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  Microsoft 'Digital Overdrive' protocol is supported by the sidewinder.cmodule. All currently supported joysticks:* Microsoft SideWinder 3D Pro* Microsoft SideWinder Force Feedback Pro* Microsoft SideWinder Force Feedback Wheel* Microsoft SideWinder FreeStyle Pro * Microsoft SideWinder GamePad (up to four, chained)* Microsoft SideWinder Precision Pro * Microsoft SideWinder Precision Pro USB   are autodetected, and thus no module parameters are needed.  There is one caveat with the 3D Pro. There are 9 buttons reported,although the joystick has only 8. The 9th button is the mode switch on therear side of the joystick. However, moving it, you'll reset the joystick,and make it unresponsive for about a one third of a second. Furthermore, thejoystick will also re-center itself, taking the position it was in duringthis time as a new center position. Use it if you want, but think first.  The SideWinder Standard is not a digital joystick, and thus is supportedby the analog driver described above. 3.3 Logitech ADI devices~~~~~~~~~~~~~~~~~~~~~~~~  Logitech ADI protocol is supported by the adi.c module. It should supportany Logitech device using this protocol. This includes, but is not limitedto:* Logitech CyberMan 2* Logitech ThunderPad Digital* Logitech WingMan Extreme Digital* Logitech WingMan Formula* Logitech WingMan Interceptor* Logitech WingMan GamePad* Logitech WingMan GamePad USB* Logitech WingMan GamePad Extreme* Logitech WingMan Extreme Digital 3D  ADI devices are autodetected, and the driver supports up to two (anycombination of) devices on a single gameport, using an Y-cable or chainedtogether.  Logitech WingMan Joystick, Logitech WingMan Attack, Logitech WingManExtreme and Logitech WingMan ThunderPad are not digital joysticks and arehandled by the analog driver described above. Logitech WingMan Warrior andLogitech Magellan are supported by serial drivers described below.  LogitechWingMan Force and Logitech WingMan Formula Force are supported by the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -