← Documents Documentation/input/joydev/joystick.rst GitHub 원문 ↗

Linux 6.18.37 · Input

Linux Joystick Support

Joydev 설치·시험·보정과 analog, gameport, serial joystick driver별 지원 정보를 설명합니다.

Source pathDocumentation/input/joydev/joystick.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

joystick.rst:1-586

Linux joystick 지원의 사용자 안내와 hardware driver catalog를 결합한 문서입니다. 먼저 joydev node·module·시험·보정을 설명하고, 이어 analog mapping과 gameport·soundcard·platform·serial·I-Force protocol별 module, 지원 model과 연결 option을 정리합니다.

문서 개요
영역핵심 항목
사용자 interface`joydev`, `/dev/input/jsN`
시험·보정`jstest`, `jscal`, `evtest`
Serial 연결`serport`, `inputattach`
Analog gameport`analog`, `analog.map`
Digital gameport`sidewinder`, `adi`, `grip`, `a3d`, `tmdc` 등
Card gameport`lightning`, `pcigame`, `cs461x`, `emu10k1-gp`
Serial protocol`spaceorb`, `spaceball`, `warrior`, `joy-magellan`
Force feedback`iforce`

사용 단계와 hardware family별 핵심 도구·module입니다.

Joystick 지원 경로
Transport와 joystick protocol 식별Joydev·gameport·serial core module 준비Hardware별 protocol driver loadSerial이면 `inputattach` 실행`/dev/input/jsN` 생성 확인`jstest`·`evtest`로 값 검증필요하면 `jscal` 보정 저장

Hardware 식별부터 game 또는 application 사용까지의 전체 경로입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. include:: <isonum.txt>
2
3 .. _joystick-doc:
4
5 Introduction
6 ============
7
8 The joystick driver for Linux provides support for a variety of joysticks
9 and similar devices. It is based on a larger project aiming to support all
10 input devices in Linux.
11
12 The mailing list for the project is:
13
14 linux-input@vger.kernel.org
15
16 send "subscribe linux-input" to majordomo@vger.kernel.org to subscribe to it.
17
18 Usage
19 =====
20
21 For basic usage you just choose the right options in kernel config and
22 you should be set.
23
24 Utilities
25 ---------
26
27 For testing and other purposes (for example serial devices), there is a set
28 of utilities, such as ``jstest``, ``jscal``, and ``evtest``,
29 usually packaged as ``joystick``, ``input-utils``, ``evtest``, and so on.
30
31 ``inputattach`` utility is required if your joystick is connected to a
32 serial port.
33
34 Device nodes
35 ------------
36
37 For applications to be able to use the joysticks, device nodes should be
38 created in /dev. Normally it is done automatically by the system, but
39 it can also be done by hand::
40
41 cd /dev
42 rm js*
43 mkdir input
44 mknod input/js0 c 13 0
45 mknod input/js1 c 13 1
46 mknod input/js2 c 13 2
47 mknod input/js3 c 13 3
48 ln -s input/js0 js0
49 ln -s input/js1 js1
50 ln -s input/js2 js2
51 ln -s input/js3 js3
52
53 For testing with inpututils it's also convenient to create these::
54
55 mknod input/event0 c 13 64
56 mknod input/event1 c 13 65
57 mknod input/event2 c 13 66
58 mknod input/event3 c 13 67
59
60 Modules needed
61 --------------
62
63 For all joystick drivers to function, you'll need the userland interface
64 module in kernel, either loaded or compiled in::
65
66 modprobe joydev
67
68 For gameport joysticks, you'll have to load the gameport driver as well::
69
70 modprobe ns558
71
72 And for serial port joysticks, you'll need the serial input line
73 discipline module loaded and the inputattach utility started::
74
75 modprobe serport
76 inputattach -xxx /dev/tts/X &
77
78 In addition to that, you'll need the joystick driver module itself, most
79 usually you'll have an analog joystick::
80
81 modprobe analog
82
83 For automatic module loading, something like this might work - tailor to
84 your needs::
85
86 alias tty-ldisc-2 serport
87 alias char-major-13 input
88 above input joydev ns558 analog
89 options analog map=gamepad,none,2btn
90
91 Verifying that it works
92 -----------------------
93
94 For testing the joystick driver functionality, there is the jstest
95 program in the utilities package. You run it by typing::
96
97 jstest /dev/input/js0
98
99 And it should show a line with the joystick values, which update as you
100 move the stick, and press its buttons. The axes should all be zero when the
101 joystick is in the center position. They should not jitter by themselves to
102 other close values, and they also should be steady in any other position of
103 the stick. They should have the full range from -32767 to 32767. If all this
104 is met, then it's all fine, and you can play the games. :)
105
106 If it's not, then there might be a problem. Try to calibrate the joystick,
107 and if it still doesn't work, read the drivers section of this file, the
108 troubleshooting section, and the FAQ.
109
110 Calibration
111 -----------
112
113 For most joysticks you won't need any manual calibration, since the
114 joystick should be autocalibrated by the driver automagically. However, with
115 some analog joysticks, that either do not use linear resistors, or if you
116 want better precision, you can use the jscal program::
117
118 jscal -c /dev/input/js0
119
120 included in the joystick package to set better correction coefficients than
121 what the driver would choose itself.
122
123 After calibrating the joystick you can verify if you like the new
124 calibration using the jstest command, and if you do, you then can save the
125 correction coefficients into a file::
126
127 jscal -p /dev/input/js0 > /etc/joystick.cal
128
129 And add a line to your rc script executing that file::
130
131 source /etc/joystick.cal
132
133 This way, after the next reboot your joystick will remain calibrated. You
134 can also add the ``jscal -p`` line to your shutdown script.
135
136 Hardware-specific driver information
137 ====================================
138
139 In this section each of the separate hardware specific drivers is described.
140
141 Analog joysticks
142 ----------------
143
144 The analog.c driver uses the standard analog inputs of the gameport, and thus
145 supports all standard joysticks and gamepads. It uses a very advanced
146 routine for this, allowing for data precision that can't be found on any
147 other system.
148
149 It also supports extensions like additional hats and buttons compatible
150 with CH Flightstick Pro, ThrustMaster FCS or 6 and 8 button gamepads. Saitek
151 Cyborg 'digital' joysticks are also supported by this driver, because
152 they're basically souped up CHF sticks.
153
154 However the only types that can be autodetected are:
155
156 * 2-axis, 4-button joystick
157 * 3-axis, 4-button joystick
158 * 4-axis, 4-button joystick
159 * Saitek Cyborg 'digital' joysticks
160
161 For other joystick types (more/less axes, hats, and buttons) support
162 you'll need to specify the types either on the kernel command line or on the
163 module command line, when inserting analog into the kernel. The
164 parameters are::
165
166 analog.map=<type1>,<type2>,<type3>,....
167
168 'type' is type of the joystick from the table below, defining joysticks
169 present on gameports in the system, starting with gameport0, second 'type'
170 entry defining joystick on gameport1 and so on.
171
172 ========= =====================================================
173 Type Meaning
174 ========= =====================================================
175 none No analog joystick on that port
176 auto Autodetect joystick
177 2btn 2-button n-axis joystick
178 y-joy Two 2-button 2-axis joysticks on an Y-cable
179 y-pad Two 2-button 2-axis gamepads on an Y-cable
180 fcs Thrustmaster FCS compatible joystick
181 chf Joystick with a CH Flightstick compatible hat
182 fullchf CH Flightstick compatible with two hats and 6 buttons
183 gamepad 4/6-button n-axis gamepad
184 gamepad8 8-button 2-axis gamepad
185 ========= =====================================================
186
187 In case your joystick doesn't fit in any of the above categories, you can
188 specify the type as a number by combining the bits in the table below. This
189 is not recommended unless you really know what are you doing. It's not
190 dangerous, but not simple either.
191
192 ==== =========================
193 Bit Meaning
194 ==== =========================
195 0 Axis X1
196 1 Axis Y1
197 2 Axis X2
198 3 Axis Y2
199 4 Button A
200 5 Button B
201 6 Button C
202 7 Button D
203 8 CHF Buttons X and Y
204 9 CHF Hat 1
205 10 CHF Hat 2
206 11 FCS Hat
207 12 Pad Button X
208 13 Pad Button Y
209 14 Pad Button U
210 15 Pad Button V
211 16 Saitek F1-F4 Buttons
212 17 Saitek Digital Mode
213 19 GamePad
214 20 Joy2 Axis X1
215 21 Joy2 Axis Y1
216 22 Joy2 Axis X2
217 23 Joy2 Axis Y2
218 24 Joy2 Button A
219 25 Joy2 Button B
220 26 Joy2 Button C
221 27 Joy2 Button D
222 31 Joy2 GamePad
223 ==== =========================
224
225 Microsoft SideWinder joysticks
226 ------------------------------
227
228 Microsoft 'Digital Overdrive' protocol is supported by the sidewinder.c
229 module. All currently supported joysticks:
230
231 * Microsoft SideWinder 3D Pro
232 * Microsoft SideWinder Force Feedback Pro
233 * Microsoft SideWinder Force Feedback Wheel
234 * Microsoft SideWinder FreeStyle Pro
235 * Microsoft SideWinder GamePad (up to four, chained)
236 * Microsoft SideWinder Precision Pro
237 * Microsoft SideWinder Precision Pro USB
238
239 are autodetected, and thus no module parameters are needed.
240
241 There is one caveat with the 3D Pro. There are 9 buttons reported,
242 although the joystick has only 8. The 9th button is the mode switch on the
243 rear side of the joystick. However, moving it, you'll reset the joystick,
244 and make it unresponsive for about a one third of a second. Furthermore, the
245 joystick will also re-center itself, taking the position it was in during
246 this time as a new center position. Use it if you want, but think first.
247
248 The SideWinder Standard is not a digital joystick, and thus is supported
249 by the analog driver described above.
250
251 Logitech ADI devices
252 --------------------
253
254 Logitech ADI protocol is supported by the adi.c module. It should support
255 any Logitech device using this protocol. This includes, but is not limited
256 to:
257
258 * Logitech CyberMan 2
259 * Logitech ThunderPad Digital
260 * Logitech WingMan Extreme Digital
261 * Logitech WingMan Formula
262 * Logitech WingMan Interceptor
263 * Logitech WingMan GamePad
264 * Logitech WingMan GamePad USB
265 * Logitech WingMan GamePad Extreme
266 * Logitech WingMan Extreme Digital 3D
267
268 ADI devices are autodetected, and the driver supports up to two (any
269 combination of) devices on a single gameport, using a Y-cable or chained
270 together.
271
272 Logitech WingMan Joystick, Logitech WingMan Attack, Logitech WingMan
273 Extreme and Logitech WingMan ThunderPad are not digital joysticks and are
274 handled by the analog driver described above. Logitech WingMan Warrior and
275 Logitech Magellan are supported by serial drivers described below. Logitech
276 WingMan Force and Logitech WingMan Formula Force are supported by the
277 I-Force driver described below. Logitech CyberMan is not supported yet.
278
279 Gravis GrIP
280 -----------
281
282 Gravis GrIP protocol is supported by the grip.c module. It currently
283 supports:
284
285 * Gravis GamePad Pro
286 * Gravis BlackHawk Digital
287 * Gravis Xterminator
288 * Gravis Xterminator DualControl
289
290 All these devices are autodetected, and you can even use any combination
291 of up to two of these pads either chained together or using a Y-cable on a
292 single gameport.
293
294 GrIP MultiPort isn't supported yet. Gravis Stinger is a serial device and is
295 supported by the stinger driver. Other Gravis joysticks are supported by the
296 analog driver.
297
298 FPGaming A3D and MadCatz A3D
299 ----------------------------
300
301 The Assassin 3D protocol created by FPGaming, is used both by FPGaming
302 themselves and is licensed to MadCatz. A3D devices are supported by the
303 a3d.c module. It currently supports:
304
305 * FPGaming Assassin 3D
306 * MadCatz Panther
307 * MadCatz Panther XL
308
309 All these devices are autodetected. Because the Assassin 3D and the Panther
310 allow connecting analog joysticks to them, you'll need to load the analog
311 driver as well to handle the attached joysticks.
312
313 The trackball should work with USB mousedev module as a normal mouse. See
314 the USB documentation for how to setup a USB mouse.
315
316 ThrustMaster DirectConnect (BSP)
317 --------------------------------
318
319 The TM DirectConnect (BSP) protocol is supported by the tmdc.c
320 module. This includes, but is not limited to:
321
322 * ThrustMaster Millennium 3D Interceptor
323 * ThrustMaster 3D Rage Pad
324 * ThrustMaster Fusion Digital Game Pad
325
326 Devices not directly supported, but hopefully working are:
327
328 * ThrustMaster FragMaster
329 * ThrustMaster Attack Throttle
330
331 If you have one of these, contact me.
332
333 TMDC devices are autodetected, and thus no parameters to the module
334 are needed. Up to two TMDC devices can be connected to one gameport, using
335 a Y-cable.
336
337 Creative Labs Blaster
338 ---------------------
339
340 The Blaster protocol is supported by the cobra.c module. It supports only
341 the:
342
343 * Creative Blaster GamePad Cobra
344
345 Up to two of these can be used on a single gameport, using a Y-cable.
346
347 Genius Digital joysticks
348 ------------------------
349
350 The Genius digitally communicating joysticks are supported by the gf2k.c
351 module. This includes:
352
353 * Genius Flight2000 F-23 joystick
354 * Genius Flight2000 F-31 joystick
355 * Genius G-09D gamepad
356
357 Other Genius digital joysticks are not supported yet, but support can be
358 added fairly easily.
359
360 InterAct Digital joysticks
361 --------------------------
362
363 The InterAct digitally communicating joysticks are supported by the
364 interact.c module. This includes:
365
366 * InterAct HammerHead/FX gamepad
367 * InterAct ProPad8 gamepad
368
369 Other InterAct digital joysticks are not supported yet, but support can be
370 added fairly easily.
371
372 PDPI Lightning 4 gamecards
373 --------------------------
374
375 PDPI Lightning 4 gamecards are supported by the lightning.c module.
376 Once the module is loaded, the analog driver can be used to handle the
377 joysticks. Digitally communicating joystick will work only on port 0, while
378 using Y-cables, you can connect up to 8 analog joysticks to a single L4
379 card, 16 in case you have two in your system.
380
381 Trident 4DWave / Aureal Vortex
382 ------------------------------
383
384 Soundcards with a Trident 4DWave DX/NX or Aureal Vortex/Vortex2 chipset
385 provide an "Enhanced Game Port" mode where the soundcard handles polling the
386 joystick. This mode is supported by the pcigame.c module. Once loaded the
387 analog driver can use the enhanced features of these gameports..
388
389 Crystal SoundFusion
390 -------------------
391
392 Soundcards with Crystal SoundFusion chipsets provide an "Enhanced Game
393 Port", much like the 4DWave or Vortex above. This, and also the normal mode
394 for the port of the SoundFusion is supported by the cs461x.c module.
395
396 SoundBlaster Live!
397 ------------------
398
399 The Live! has a special PCI gameport, which, although it doesn't provide
400 any "Enhanced" stuff like 4DWave and friends, is quite a bit faster than
401 its ISA counterparts. It also requires special support, hence the
402 emu10k1-gp.c module for it instead of the normal ns558.c one.
403
404 SoundBlaster 64 and 128 - ES1370 and ES1371, ESS Solo1 and S3 SonicVibes
405 ------------------------------------------------------------------------
406
407 These PCI soundcards have specific gameports. They are handled by the
408 sound drivers themselves. Make sure you select gameport support in the
409 joystick menu and sound card support in the sound menu for your appropriate
410 card.
411
412 Amiga
413 -----
414
415 Amiga joysticks, connected to an Amiga, are supported by the amijoy.c
416 driver. Since they can't be autodetected, the driver has a command line:
417
418 amijoy.map=<a>,<b>
419
420 a and b define the joysticks connected to the JOY0DAT and JOY1DAT ports of
421 the Amiga.
422
423 ====== ===========================
424 Value Joystick type
425 ====== ===========================
426 0 None
427 1 1-button digital joystick
428 ====== ===========================
429
430 No more joystick types are supported now, but that should change in the
431 future if I get an Amiga in the reach of my fingers.
432
433 Game console and 8-bit pads and joysticks
434 -----------------------------------------
435
436 These pads and joysticks are not designed for PCs and other computers
437 Linux runs on, and usually require a special connector for attaching
438 them through a parallel port.
439
440 See :ref:`joystick-parport` for more info.
441
442 SpaceTec/LabTec devices
443 -----------------------
444
445 SpaceTec serial devices communicate using the SpaceWare protocol. It is
446 supported by the spaceorb.c and spaceball.c drivers. The devices currently
447 supported by spaceorb.c are:
448
449 * SpaceTec SpaceBall Avenger
450 * SpaceTec SpaceOrb 360
451
452 Devices currently supported by spaceball.c are:
453
454 * SpaceTec SpaceBall 4000 FLX
455
456 In addition to having the spaceorb/spaceball and serport modules in the
457 kernel, you also need to attach a serial port to it. To do that, run the
458 inputattach program::
459
460 inputattach --spaceorb /dev/tts/x &
461
462 or::
463
464 inputattach --spaceball /dev/tts/x &
465
466 where /dev/tts/x is the serial port which the device is connected to. After
467 doing this, the device will be reported and will start working.
468
469 There is one caveat with the SpaceOrb. The button #6, the one on the bottom
470 side of the orb, although reported as an ordinary button, causes internal
471 recentering of the spaceorb, moving the zero point to the position in which
472 the ball is at the moment of pressing the button. So, think first before
473 you bind it to some other function.
474
475 SpaceTec SpaceBall 2003 FLX and 3003 FLX are not supported yet.
476
477 Logitech SWIFT devices
478 ----------------------
479
480 The SWIFT serial protocol is supported by the warrior.c module. It
481 currently supports only the:
482
483 * Logitech WingMan Warrior
484
485 but in the future, Logitech CyberMan (the original one, not CM2) could be
486 supported as well. To use the module, you need to run inputattach after you
487 insert/compile the module into your kernel::
488
489 inputattach --warrior /dev/tts/x &
490
491 /dev/tts/x is the serial port your Warrior is attached to.
492
493 Magellan / Space Mouse
494 ----------------------
495
496 The Magellan (or Space Mouse), manufactured by LogiCad3d (formerly Space
497 Systems), for many other companies (Logitech, HP, ...) is supported by the
498 joy-magellan module. It currently supports only the:
499
500 * Magellan 3D
501 * Space Mouse
502
503 models; the additional buttons on the 'Plus' versions are not supported yet.
504
505 To use it, you need to attach the serial port to the driver using the::
506
507 inputattach --magellan /dev/tts/x &
508
509 command. After that the Magellan will be detected, initialized, will beep,
510 and the /dev/input/jsX device should become usable.
511
512 I-Force devices
513 ---------------
514
515 All I-Force devices are supported by the iforce module. This includes:
516
517 * AVB Mag Turbo Force
518 * AVB Top Shot Pegasus
519 * AVB Top Shot Force Feedback Racing Wheel
520 * Boeder Force Feedback Wheel
521 * Logitech WingMan Force
522 * Logitech WingMan Force Wheel
523 * Guillemot Race Leader Force Feedback
524 * Guillemot Force Feedback Racing Wheel
525 * Thrustmaster Motor Sport GT
526
527 To use it, you need to attach the serial port to the driver using the::
528
529 inputattach --iforce /dev/tts/x &
530
531 command. After that the I-Force device will be detected, and the
532 /dev/input/jsX device should become usable.
533
534 In case you're using the device via the USB port, the inputattach command
535 isn't needed.
536
537 The I-Force driver now supports force feedback via the event interface.
538
539 Please note that Logitech WingMan 3D devices are _not_ supported by this
540 module, rather by hid. Force feedback is not supported for those devices.
541 Logitech gamepads are also hid devices.
542
543 Gravis Stinger gamepad
544 ----------------------
545
546 The Gravis Stinger serial port gamepad, designed for use with laptop
547 computers, is supported by the stinger.c module. To use it, attach the
548 serial port to the driver using::
549
550 inputattach --stinger /dev/tty/x &
551
552 where x is the number of the serial port.
553
554 Troubleshooting
555 ===============
556
557 There is quite a high probability that you run into some problems. For
558 testing whether the driver works, if in doubt, use the jstest utility in
559 some of its modes. The most useful modes are "normal" - for the 1.x
560 interface, and "old" for the "0.x" interface. You run it by typing::
561
562 jstest --normal /dev/input/js0
563 jstest --old /dev/input/js0
564
565 Additionally you can do a test with the evtest utility::
566
567 evtest /dev/input/event0
568
569 Oh, and read the FAQ! :)
570
571 FAQ
572 ===
573
574 :Q: Running 'jstest /dev/input/js0' results in "File not found" error. What's the
575 cause?
576 :A: The device files don't exist. Create them (see section 2.2).
577
578 :Q: Is it possible to connect my old Atari/Commodore/Amiga/console joystick
579 or pad that uses a 9-pin D-type Cannon connector to the serial port of my
580 PC?
581 :A: Yes, it is possible, but it'll burn your serial port or the pad. It
582 won't work, of course.
583
584 :Q: My joystick doesn't work with Quake / Quake 2. What's the cause?
585 :A: Quake / Quake 2 don't support joystick. Use joy2key to simulate keypresses
586 for them.
587

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Joystick 지원, 기본 사용과 calibration

1-135

Linux joystick driver는 다양한 joystick과 유사 장치를 지원하며 Linux의 모든 input device를 지원하려는 더 큰 input subsystem project의 일부입니다. 문서에 적힌 project mailing list는 `linux-input@vger.kernel.org`입니다.

기본 사용은 kernel configuration에서 알맞은 option을 선택하는 것으로 시작합니다. 시험과 serial 장치 연결에는 보통 `joystick`, `input-utils`, `evtest` package에 포함된 `jstest`, `jscal`, `evtest`가 필요하고 serial port joystick에는 `inputattach`가 필수입니다.

Joystick utility
도구용도
`jstest`Joydev axis·button 시험
`jscal`Analog joystick correction 보정·저장
`evtest`Generic evdev event 시험
`inputattach`Serial port를 input driver에 연결

설치·시험·보정·serial 연결에 쓰는 사용자 공간 도구입니다.

Application이 joystick을 사용하려면 `/dev/input/jsN` node가 있어야 합니다. 보통 system이 자동 생성하지만 수동으로는 major 13, minor 0~3으로 `js0`~`js3`를 만들고 필요하면 `/dev/jsN` symbolic link를 둡니다. Input utility 시험용 `event0`~`event3`은 major 13, minor 64~67입니다.

예제 device node
NodeTypeMajorMinor
`/dev/input/js0`Character130
`/dev/input/js1`Character131
`/dev/input/js2`Character132
`/dev/input/js3`Character133
`/dev/input/event0`Character1364
`/dev/input/event1`Character1365
`/dev/input/event2`Character1366
`/dev/input/event3`Character1367

원문의 수동 node 생성 예에서 major·minor mapping을 보존했습니다.

모든 joystick driver에는 사용자 공간 interface인 `joydev`가 필요합니다. Gameport joystick은 `ns558`, serial joystick은 `serport`와 `inputattach`, 일반 analog joystick은 `analog` module도 필요합니다.

연결 방식별 module
연결필수 module·도구
공통`joydev`
Classic gameport`ns558` + joystick protocol driver
Serial port`serport` + `inputattach` + protocol driver
Analog joystick`analog`

Hardware transport와 실제 joystick protocol driver를 함께 load합니다.

자동 module load 예는 `tty-ldisc-2`를 `serport`, character major 13을 `input`에 연결하고 input 위에 `joydev ns558 analog`를 load하며 `analog map=gamepad,none,2btn` option을 설정합니다. 실제 system에 맞게 조정해야 합니다.

`jstest /dev/input/js0`은 stick 이동과 button press에 따라 갱신되는 값을 보여야 합니다. 중앙에서 모든 axis는 0이고 스스로 가까운 값 사이를 흔들리지 않아야 하며 다른 위치에서도 안정적이어야 합니다. 전체 범위는 -32767부터 32767입니다.

이 조건을 만족하지 않으면 먼저 calibration하고 계속 실패하면 driver 절, troubleshooting, FAQ를 확인합니다. 대부분은 driver가 자동 보정하지만 비선형 resistor analog joystick이나 더 높은 정밀도가 필요하면 `jscal -c /dev/input/js0`로 correction coefficient를 조정합니다.

새 보정은 `jstest`로 확인하고 만족하면 `jscal -p /dev/input/js0 > /etc/joystick.cal`로 저장합니다. Boot rc script에서 `source /etc/joystick.cal`을 실행하면 reboot 뒤에도 유지되며, shutdown script에 `jscal -p` 저장 명령을 넣을 수도 있습니다.

Joystick 준비와 보정
Kernel에서 joydev와 transport·protocol driver 선택필요한 module load와 serial `inputattach` 실행`/dev/input/js0` node 확인`jstest`로 중앙·jitter·전체 범위 확인필요하면 `jscal -c`로 calibration`jscal -p` 결과를 boot script에 저장

Kernel 지원부터 영구 calibration까지의 일반 절차입니다.

.. include:: <isonum.txt>

.. _joystick-doc:

Introduction
============

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
input devices in Linux.

The mailing list for the project is:

        linux-input@vger.kernel.org

send "subscribe linux-input" to majordomo@vger.kernel.org to subscribe to it.

Usage
=====

For basic usage you just choose the right options in kernel config and
you should be set.

Utilities
---------

For testing and other purposes (for example serial devices), there is a set
of utilities, such as ``jstest``, ``jscal``, and ``evtest``,
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
------------

For applications to be able to use the joysticks, device nodes should be
created in /dev. Normally it is done automatically by the system, but
it can also be done by hand::

    cd /dev
    rm js*
    mkdir input
    mknod input/js0 c 13 0
    mknod input/js1 c 13 1
    mknod input/js2 c 13 2
    mknod input/js3 c 13 3
    ln -s input/js0 js0
    ln -s input/js1 js1
    ln -s input/js2 js2
    ln -s input/js3 js3

For testing with inpututils it's also convenient to create these::

    mknod input/event0 c 13 64
    mknod input/event1 c 13 65
    mknod input/event2 c 13 66
    mknod input/event3 c 13 67

Modules needed
--------------

For all joystick drivers to function, you'll need the userland interface
module 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 line
discipline 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, most
usually you'll have an analog joystick::

        modprobe analog

For automatic module loading, something like this might work - tailor to
your needs::

        alias tty-ldisc-2 serport
        alias char-major-13 input
        above input joydev ns558 analog
        options analog map=gamepad,none,2btn

Verifying that it works
-----------------------

For testing the joystick driver functionality, there is the jstest
program in the utilities package. You run it by typing::

        jstest /dev/input/js0

And it should show a line with the joystick values, which update as you
move the stick, and press its buttons. The axes should all be zero when the
joystick is in the center position. They should not jitter by themselves to
other close values, and they also should be steady in any other position of
the stick. They should have the full range from -32767 to 32767. If all this
is 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, the
troubleshooting section, and the FAQ.

Calibration
-----------

For most joysticks you won't need any manual calibration, since the
joystick should be autocalibrated by the driver automagically. However, with
some analog joysticks, that either do not use linear resistors, or if you
want better precision, you can use the jscal program::

        jscal -c /dev/input/js0

included in the joystick package to set better correction coefficients than
what the driver would choose itself.

After calibrating the joystick you can verify if you like the new
calibration using the jstest command, and if you do, you then can save the
correction coefficients into a file::

        jscal -p /dev/input/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. You
can also add the ``jscal -p`` line to your shutdown script.

Analog joystick driver와 `analog.map`

136-224

`analog.c` driver는 표준 gameport analog input을 사용해 모든 표준 joystick과 gamepad를 지원합니다. 높은 data precision을 제공하며 CH Flightstick Pro, ThrustMaster FCS 호환 추가 hat·button, 6·8 button gamepad, 확장된 CHF 계열인 Saitek Cyborg digital joystick도 처리합니다.

자동 탐지 가능한 것은 2-axis 4-button, 3-axis 4-button, 4-axis 4-button joystick과 Saitek Cyborg digital joystick입니다. Axis·hat·button 수가 다른 장치는 kernel command line 또는 `analog` module load 때 `analog.map=<type1>,<type2>,...`로 지정합니다.

각 `type`은 system의 gameport 순서에 대응합니다. 첫 entry는 gameport0, 두 번째는 gameport1의 joystick type입니다.

`analog.map` type
Type의미
`none`해당 port에 analog joystick 없음
`auto`Joystick 자동 탐지
`2btn`2-button n-axis joystick
`y-joy`Y-cable의 2-button 2-axis joystick 두 개
`y-pad`Y-cable의 2-button 2-axis gamepad 두 개
`fcs`ThrustMaster FCS 호환 joystick
`chf`CH Flightstick 호환 hat을 가진 joystick
`fullchf`Hat 두 개와 button 여섯 개를 가진 CH Flightstick 호환
`gamepad`4/6-button n-axis gamepad
`gamepad8`8-button 2-axis gamepad

Gameport마다 사용할 사전 정의 analog joystick 형태입니다.

사전 정의 type에 맞지 않으면 아래 bit를 조합한 숫자로 type을 만들 수 있지만 구조를 정확히 알 때만 권장됩니다. 위험하지는 않지만 단순하지 않습니다.

Numeric analog mapping bit
Bit의미
0Axis X1
1Axis Y1
2Axis X2
3Axis Y2
4Button A
5Button B
6Button C
7Button D
8CHF Buttons X and Y
9CHF Hat 1
10CHF Hat 2
11FCS Hat
12Pad Button X
13Pad Button Y
14Pad Button U
15Pad Button V
16Saitek F1-F4 Buttons
17Saitek Digital Mode
19GamePad
20Joy2 Axis X1
21Joy2 Axis Y1
22Joy2 Axis X2
23Joy2 Axis Y2
24Joy2 Button A
25Joy2 Button B
26Joy2 Button C
27Joy2 Button D
31Joy2 GamePad

첫 joystick과 Y-cable의 두 번째 joystick 기능을 bitmask로 조합합니다.

Analog mapping 선택
표준 자동 탐지 형태인지 확인가능하면 `auto` 사용장치 형태가 알려졌으면 사전 정의 type 선택Gameport 순서대로 `analog.map` entry 배치어떤 type에도 맞지 않을 때만 numeric bitmask 조합`jstest`로 axis·button 결과 검증

자동 탐지에서 사전 정의 type과 numeric bitmask 순서로 좁혀 갑니다.

Hardware-specific driver information
====================================

In this section each of the separate hardware specific drivers is described.

Analog joysticks
----------------

The analog.c driver uses the standard analog inputs of the gameport, and thus
supports all standard joysticks and gamepads. It uses a very advanced
routine for this, allowing for data precision that can't be found on any
other system.

It also supports extensions like additional hats and buttons compatible
with CH Flightstick Pro, ThrustMaster FCS or 6 and 8 button gamepads. Saitek
Cyborg 'digital' joysticks are also supported by this driver, because
they'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) support
you'll need to specify the types either on the kernel command line or on the
module command line, when inserting analog into the kernel. The
parameters are::

        analog.map=<type1>,<type2>,<type3>,....

'type' is type of the joystick from the table below, defining joysticks
present 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 can
specify the type as a number by combining the bits in the table below. This
is not recommended unless you really know what are you doing. It's not
dangerous, 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 GamePad
        ==== =========================

Gameport digital protocol 장치

225-315

Microsoft Digital Overdrive protocol은 `sidewinder.c`가 지원하며 SideWinder 3D Pro, Force Feedback Pro, Force Feedback Wheel, FreeStyle Pro, 최대 네 개를 chain할 수 있는 GamePad, Precision Pro, Precision Pro USB를 자동 탐지합니다. Module parameter는 필요 없습니다.

SideWinder 3D Pro는 물리 button이 8개지만 mode switch를 아홉 번째 button으로 보고합니다. Switch를 움직이면 joystick이 reset되어 약 1/3초 응답하지 않고 그 순간 위치를 새 center로 삼으므로 다른 기능에 연결하기 전에 주의해야 합니다. SideWinder Standard는 digital이 아니어서 `analog` driver가 처리합니다.

Microsoft SideWinder 지원
장치비고
SideWinder 3D ProMode switch가 9th button, reset·recenter 주의
SideWinder Force Feedback Pro자동 탐지
SideWinder Force Feedback Wheel자동 탐지
SideWinder FreeStyle Pro자동 탐지
SideWinder GamePad최대 4개 chain
SideWinder Precision Pro자동 탐지
SideWinder Precision Pro USB자동 탐지

`sidewinder.c`가 자동 탐지하는 Digital Overdrive 장치입니다.

Logitech ADI protocol은 `adi.c`가 지원하며 한 gameport에 Y-cable 또는 chain으로 임의 조합 두 장치까지 자동 탐지합니다.

Logitech ADI 지원
장치지원
Logitech CyberMan 2ADI automatic
Logitech ThunderPad DigitalADI automatic
Logitech WingMan Extreme DigitalADI automatic
Logitech WingMan FormulaADI automatic
Logitech WingMan InterceptorADI automatic
Logitech WingMan GamePadADI automatic
Logitech WingMan GamePad USBADI automatic
Logitech WingMan GamePad ExtremeADI automatic
Logitech WingMan Extreme Digital 3DADI automatic

`adi.c`가 처리하는 명시된 장치 목록입니다.

WingMan Joystick, Attack, Extreme, ThunderPad는 digital이 아니어서 `analog`가 처리합니다. WingMan Warrior와 Magellan은 뒤에서 설명하는 serial driver, WingMan Force와 Formula Force는 I-Force driver가 처리합니다. 원본 CyberMan은 아직 지원하지 않습니다.

Gravis GrIP protocol은 `grip.c`가 GamePad Pro, BlackHawk Digital, Xterminator, Xterminator DualControl을 자동 탐지하며 한 gameport에 chain 또는 Y-cable로 임의 조합 두 개까지 지원합니다. GrIP MultiPort는 미지원, Stinger는 serial `stinger`, 그 밖의 Gravis joystick은 `analog`가 처리합니다.

Gravis GrIP 지원
장치연결
Gravis GamePad ProChain 또는 Y-cable
Gravis BlackHawk DigitalChain 또는 Y-cable
Gravis XterminatorChain 또는 Y-cable
Gravis Xterminator DualControlChain 또는 Y-cable

`grip.c`가 자동 탐지하는 네 device입니다.

FPGaming의 Assassin 3D protocol은 MadCatz에도 license되었으며 `a3d.c`가 FPGaming Assassin 3D, MadCatz Panther, Panther XL을 자동 탐지합니다. Assassin 3D와 Panther에 연결한 analog joystick을 처리하려면 `analog` driver도 load해야 합니다. Trackball은 USB `mousedev`에서 일반 mouse로 동작해야 합니다.

A3D 지원
장치추가 조건
FPGaming Assassin 3D연결된 analog joystick에는 `analog` 필요
MadCatz Panther연결된 analog joystick에는 `analog` 필요
MadCatz Panther XL자동 탐지
TrackballUSB `mousedev`를 일반 mouse로 사용

`a3d.c` 장치와 추가 driver 요구사항입니다.

Gameport digital driver 선택
장치 family와 digital protocol 확인SideWinder는 `sidewinder` 선택Logitech ADI는 `adi` 선택Gravis GrIP는 `grip` 선택Assassin 3D는 `a3d` 선택Attached analog control이 있으면 `analog` 추가

Protocol과 장치 family에 따라 module 및 보조 driver를 고릅니다.

Microsoft SideWinder joysticks
------------------------------

Microsoft 'Digital Overdrive' protocol is supported by the sidewinder.c
module. 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 the
rear 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, the
joystick will also re-center itself, taking the position it was in during
this 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 supported
by the analog driver described above.

Logitech ADI devices
--------------------

Logitech ADI protocol is supported by the adi.c module. It should support
any Logitech device using this protocol. This includes, but is not limited
to:

* 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 (any
combination of) devices on a single gameport, using a Y-cable or chained
together.

Logitech WingMan Joystick, Logitech WingMan Attack, Logitech WingMan
Extreme and Logitech WingMan ThunderPad are not digital joysticks and are
handled by the analog driver described above. Logitech WingMan Warrior and
Logitech Magellan are supported by serial drivers described below.  Logitech
WingMan Force and Logitech WingMan Formula Force are supported by the
I-Force driver described below. Logitech CyberMan is not supported yet.

Gravis GrIP
-----------

Gravis GrIP protocol is supported by the grip.c module. It currently
supports:

* Gravis GamePad Pro
* Gravis BlackHawk Digital
* Gravis Xterminator
* Gravis Xterminator DualControl

All these devices are autodetected, and you can even use any combination
of up to two of these pads either chained together or using a Y-cable on a
single gameport.

GrIP MultiPort isn't supported yet. Gravis Stinger is a serial device and is
supported by the stinger driver. Other Gravis joysticks are supported by the
analog driver.

FPGaming A3D and MadCatz A3D
----------------------------

The Assassin 3D protocol created by FPGaming, is used both by FPGaming
themselves and is licensed to MadCatz. A3D devices are supported by the
a3d.c module. It currently supports:

* FPGaming Assassin 3D
* MadCatz Panther
* MadCatz Panther XL

All these devices are autodetected. Because the Assassin 3D and the Panther
allow connecting analog joysticks to them, you'll need to load the analog
driver as well to handle the attached joysticks.

The trackball should work with USB mousedev module as a normal mouse. See
the USB documentation for how to setup a USB mouse.

기타 gameport, soundcard와 platform 장치

316-440

ThrustMaster DirectConnect(BSP) protocol은 `tmdc.c`가 Millennium 3D Interceptor, 3D Rage Pad, Fusion Digital Game Pad를 지원합니다. FragMaster와 Attack Throttle은 직접 지원 대상으로 명시되지는 않았지만 동작할 가능성이 있어 사용자는 maintainer에게 결과를 알려야 합니다. 장치는 자동 탐지되고 Y-cable로 한 gameport에 두 개까지 연결합니다.

Creative Blaster protocol은 `cobra.c`가 Creative Blaster GamePad Cobra만 지원하며 Y-cable로 한 gameport에 두 개까지 사용할 수 있습니다. Genius digital joystick은 `gf2k.c`가 Flight2000 F-23, F-31, G-09D를 지원합니다. 다른 Genius digital 장치는 아직 미지원이지만 지원 추가는 비교적 쉽습니다.

InterAct digital joystick은 `interact.c`가 HammerHead/FX와 ProPad8 gamepad를 지원하며 다른 장치는 아직 미지원입니다.

TMDC·Blaster·Genius·InterAct
Module지원 장치연결·상태
`tmdc`Millennium 3D Interceptor; 3D Rage Pad; Fusion Digital Game Pad자동 탐지, Y-cable 두 개
`tmdc` 예상FragMaster; Attack Throttle동작 가능, 직접 지원 아님
`cobra`Creative Blaster GamePad CobraY-cable 두 개
`gf2k`Flight2000 F-23; F-31; G-09D기타 Genius digital 미지원
`interact`HammerHead/FX; ProPad8기타 InterAct digital 미지원

Gameport digital protocol module과 명시된 지원 장치입니다.

PDPI Lightning 4 card는 `lightning.c`를 load한 뒤 `analog` driver로 joystick을 처리합니다. Digital joystick은 port 0에서만 동작합니다. Y-cable을 쓰면 L4 card 한 장에 analog joystick 8개, 두 장이면 16개까지 연결할 수 있습니다.

Trident 4DWave DX/NX와 Aureal Vortex/Vortex2 soundcard의 Enhanced Game Port는 card가 joystick polling을 수행하며 `pcigame.c`가 지원합니다. Load 후 `analog` driver가 향상된 기능을 사용합니다. Crystal SoundFusion의 Enhanced와 normal mode gameport는 `cs461x.c`가 처리합니다.

SoundBlaster Live!의 PCI gameport는 enhanced 기능은 없지만 ISA보다 빠르고 특별 지원이 필요해 `ns558.c` 대신 `emu10k1-gp.c`를 사용합니다. SoundBlaster 64·128의 ES1370·ES1371, ESS Solo1, S3 SonicVibes PCI soundcard gameport는 sound driver 자체가 처리하므로 joystick menu의 gameport 지원과 해당 sound card 지원을 함께 선택합니다.

Gamecard와 soundcard gameport
HardwareModule비고
PDPI Lightning 4`lightning` + `analog`Digital은 port 0, analog 최대 8/card
Trident 4DWave / Aureal Vortex`pcigame` + `analog`Enhanced polling
Crystal SoundFusion`cs461x`Enhanced와 normal mode
SoundBlaster Live!`emu10k1-gp`Special fast PCI gameport
SB64/128, ESS Solo1, S3 SonicVibes각 sound driverGameport와 sound 지원 모두 선택

전용 gameport driver와 analog driver 결합입니다.

Amiga joystick은 `amijoy.c`가 지원하지만 자동 탐지할 수 없어 `amijoy.map=<a>,<b>`를 사용합니다. a와 b는 `JOY0DAT`, `JOY1DAT` port에 연결된 장치를 나타내며 0은 없음, 1은 1-button digital joystick입니다.

`amijoy.map` value
ValueJoystick type
0None
11-button digital joystick

두 Amiga joystick port 각각에 지정할 type입니다.

Game console과 8-bit pad·joystick은 PC용이 아니어서 parallel port용 특수 connector가 보통 필요합니다. 자세한 내용은 `joystick-parport` 문서를 참고합니다.

Platform gameport 구성
Soundcard·gamecard의 gameport controller 식별Controller 전용 module 선택필요하면 `analog` protocol driver 추가Platform option이나 map parameter 설정`jstest`로 노출된 joystick 검증

Card별 gameport driver와 protocol driver를 계층적으로 load합니다.

ThrustMaster DirectConnect (BSP)
--------------------------------

The TM DirectConnect (BSP) protocol is supported by the tmdc.c
module. This includes, but is not limited to:

* ThrustMaster Millennium 3D Interceptor
* ThrustMaster 3D Rage Pad
* ThrustMaster Fusion Digital Game Pad

Devices not directly supported, but hopefully working are:

* ThrustMaster FragMaster
* ThrustMaster Attack Throttle

If you have one of these, contact me.

TMDC devices are autodetected, and thus no parameters to the module
are needed. Up to two TMDC devices can be connected to one gameport, using
a Y-cable.

Creative Labs Blaster
---------------------

The Blaster protocol is supported by the cobra.c module. It supports only
the:

* Creative Blaster GamePad Cobra

Up to two of these can be used on a single gameport, using a Y-cable.

Genius Digital joysticks
------------------------

The Genius digitally communicating joysticks are supported by the gf2k.c
module. This includes:

* Genius Flight2000 F-23 joystick
* Genius Flight2000 F-31 joystick
* Genius G-09D gamepad

Other Genius digital joysticks are not supported yet, but support can be
added fairly easily.

InterAct Digital joysticks
--------------------------

The InterAct digitally communicating joysticks are supported by the
interact.c module. This includes:

* InterAct HammerHead/FX gamepad
* InterAct ProPad8 gamepad

Other InterAct digital joysticks are not supported yet, but support can be
added fairly easily.

PDPI Lightning 4 gamecards
--------------------------

PDPI Lightning 4 gamecards are supported by the lightning.c module.
Once the module is loaded, the analog driver can be used to handle the
joysticks. Digitally communicating joystick will work only on port 0, while
using Y-cables, you can connect up to 8 analog joysticks to a single L4
card, 16 in case you have two in your system.

Trident 4DWave / Aureal Vortex
------------------------------

Soundcards with a Trident 4DWave DX/NX or Aureal Vortex/Vortex2 chipset
provide an "Enhanced Game Port" mode where the soundcard handles polling the
joystick.  This mode is supported by the pcigame.c module. Once loaded the
analog driver can use the enhanced features of these gameports..

Crystal SoundFusion
-------------------

Soundcards with Crystal SoundFusion chipsets provide an "Enhanced Game
Port", much like the 4DWave or Vortex above. This, and also the normal mode
for the port of the SoundFusion is supported by the cs461x.c module.

SoundBlaster Live!
------------------

The Live! has a special PCI gameport, which, although it doesn't provide
any "Enhanced" stuff like 4DWave and friends, is quite a bit faster than
its ISA counterparts. It also requires special support, hence the
emu10k1-gp.c module for it instead of the normal ns558.c one.

SoundBlaster 64 and 128 - ES1370 and ES1371, ESS Solo1 and S3 SonicVibes
------------------------------------------------------------------------

These PCI soundcards have specific gameports. They are handled by the
sound drivers themselves. Make sure you select gameport support in the
joystick menu and sound card support in the sound menu for your appropriate
card.

Amiga
-----

Amiga joysticks, connected to an Amiga, are supported by the amijoy.c
driver. Since they can't be autodetected, the driver has a command line:

        amijoy.map=<a>,<b>

a and b define the joysticks connected to the JOY0DAT and JOY1DAT ports of
the Amiga.

        ====== ===========================
        Value  Joystick type
        ====== ===========================
          0    None
          1    1-button digital joystick
        ====== ===========================

No more joystick types are supported now, but that should change in the
future if I get an Amiga in the reach of my fingers.

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.

Serial, SpaceTec, SWIFT, Magellan과 I-Force

441-553

SpaceTec serial 장치는 SpaceWare protocol을 사용합니다. `spaceorb.c`는 SpaceBall Avenger와 SpaceOrb 360, `spaceball.c`는 SpaceBall 4000 FLX를 지원합니다. Kernel에 해당 module과 `serport`를 넣고 `inputattach --spaceorb /dev/tts/x` 또는 `--spaceball`을 실행하면 장치를 탐지해 동작시킵니다.

SpaceOrb 아래쪽 button #6은 일반 button으로 보고되지만 눌렀을 때 내부 recentering을 수행해 그 순간 ball 위치를 새 zero point로 삼습니다. 다른 기능에 bind할 때 주의해야 합니다. SpaceBall 2003 FLX와 3003 FLX는 아직 지원하지 않습니다.

Logitech SWIFT serial protocol은 `warrior.c`가 WingMan Warrior만 지원합니다. Module을 넣은 뒤 `inputattach --warrior /dev/tts/x`를 실행합니다. 향후 원본 Logitech CyberMan도 지원될 수 있습니다.

LogiCad3d가 여러 회사에 공급한 Magellan 또는 Space Mouse는 `joy-magellan` module이 Magellan 3D와 Space Mouse를 지원하지만 Plus version의 추가 button은 아직 지원하지 않습니다. `inputattach --magellan /dev/tts/x` 뒤 장치가 탐지·초기화되고 beep하며 `/dev/input/jsX`가 사용 가능해집니다.

Space·serial protocol 장치
Module지원 장치Attach option
`spaceorb`SpaceBall Avenger; SpaceOrb 360`--spaceorb`
`spaceball`SpaceBall 4000 FLX`--spaceball`
`warrior`Logitech WingMan Warrior`--warrior`
`joy-magellan`Magellan 3D; Space Mouse`--magellan`

Driver module, 지원 model과 `inputattach` option입니다.

모든 I-Force 장치는 `iforce` module이 지원합니다.

I-Force 지원 장치
장치지원
AVB Mag Turbo Force`iforce`
AVB Top Shot Pegasus`iforce`
AVB Top Shot Force Feedback Racing Wheel`iforce`
Boeder Force Feedback Wheel`iforce`
Logitech WingMan Force`iforce`
Logitech WingMan Force Wheel`iforce`
Guillemot Race Leader Force Feedback`iforce`
Guillemot Force Feedback Racing Wheel`iforce`
Thrustmaster Motor Sport GT`iforce`

문서가 명시한 I-Force joystick과 wheel입니다.

Serial I-Force는 `inputattach --iforce /dev/tts/x`를 실행하면 탐지되고 `/dev/input/jsX`가 사용 가능해집니다. USB 연결이면 `inputattach`가 필요 없습니다. I-Force driver는 event interface를 통한 force feedback을 지원합니다.

Logitech WingMan 3D는 I-Force가 아니라 HID가 지원하며 force feedback은 지원하지 않습니다. Logitech gamepad도 HID 장치입니다.

Laptop용 Gravis Stinger serial gamepad는 `stinger.c`가 지원합니다. `inputattach --stinger /dev/tty/x`를 사용하며 x는 serial port 번호입니다.

I-Force와 Stinger 연결
장치·transport연결
I-Force serial`inputattach --iforce /dev/tts/x`
I-Force USB`inputattach` 불필요
Gravis Stinger serial`inputattach --stinger /dev/tty/x`
Logitech WingMan 3DHID 사용, I-Force FF 미지원

Transport에 따라 `inputattach` 필요 여부가 다릅니다.

Serial joystick 연결
`serport`와 protocol module 준비장치가 연결된 `/dev/tts/x` 또는 `/dev/tty/x` 확인Protocol별 `inputattach --option` 실행Driver가 장치 탐지·초기화`/dev/input/jsX` 생성 확인`jstest` 또는 `evtest`로 검증

Protocol driver와 serial line discipline을 device node에 연결합니다.


SpaceTec/LabTec devices
-----------------------

SpaceTec serial devices communicate using the SpaceWare protocol. It is
supported by the spaceorb.c and spaceball.c drivers. The devices currently
supported by spaceorb.c are:

* SpaceTec SpaceBall Avenger
* SpaceTec SpaceOrb 360

Devices currently supported by spaceball.c are:

* SpaceTec SpaceBall 4000 FLX

In addition to having the spaceorb/spaceball and serport modules in the
kernel, you also need to attach a serial port to it. To do that, run the
inputattach program::

        inputattach --spaceorb /dev/tts/x &

or::

        inputattach --spaceball /dev/tts/x &

where /dev/tts/x is the serial port which the device is connected to. After
doing this, the device will be reported and will start working.

There is one caveat with the SpaceOrb. The button #6, the one on the bottom
side of the orb, although reported as an ordinary button, causes internal
recentering of the spaceorb, moving the zero point to the position in which
the ball is at the moment of pressing the button. So, think first before
you bind it to some other function.

SpaceTec SpaceBall 2003 FLX and 3003 FLX are not supported yet.

Logitech SWIFT devices
----------------------

The SWIFT serial protocol is supported by the warrior.c module. It
currently supports only the:

* Logitech WingMan Warrior

but in the future, Logitech CyberMan (the original one, not CM2) could be
supported as well. To use the module, you need to run inputattach after you
insert/compile the module into your kernel::

        inputattach --warrior /dev/tts/x &

/dev/tts/x is the serial port your Warrior is attached to.

Magellan / Space Mouse
----------------------

The Magellan (or Space Mouse), manufactured by LogiCad3d (formerly Space
Systems), for many other companies (Logitech, HP, ...) is supported by the
joy-magellan module. It currently supports only the:

* Magellan 3D
* Space Mouse

models; the additional buttons on the 'Plus' versions are not supported yet.

To use it, you need to attach the serial port to the driver using the::

        inputattach --magellan /dev/tts/x &

command. After that the Magellan will be detected, initialized, will beep,
and the /dev/input/jsX device should become usable.

I-Force devices
---------------

All I-Force devices are supported by the iforce module. This includes:

* AVB Mag Turbo Force
* AVB Top Shot Pegasus
* AVB Top Shot Force Feedback Racing Wheel
* Boeder Force Feedback Wheel
* Logitech WingMan Force
* Logitech WingMan Force Wheel
* Guillemot Race Leader Force Feedback
* Guillemot Force Feedback Racing Wheel
* Thrustmaster Motor Sport GT

To use it, you need to attach the serial port to the driver using the::

        inputattach --iforce /dev/tts/x &

command. After that the I-Force device will be detected, and the
/dev/input/jsX device should become usable.

In case you're using the device via the USB port, the inputattach command
isn't needed.

The I-Force driver now supports force feedback via the event interface.

Please note that Logitech WingMan 3D devices are _not_ supported by this
module, rather by hid. Force feedback is not supported for those devices.
Logitech gamepads are also hid devices.

Gravis Stinger gamepad
----------------------

The Gravis Stinger serial port gamepad, designed for use with laptop
computers, is supported by the stinger.c module. To use it, attach the
serial port to the driver using::

        inputattach --stinger /dev/tty/x &

where x is the number of the serial port.

문제 해결과 FAQ

554-586

문제가 의심되면 `jstest`의 `--normal` mode로 1.x interface, `--old` mode로 0.x interface를 시험합니다. Generic event는 `evtest /dev/input/event0`으로 확인하고 FAQ도 읽어야 합니다.

Troubleshooting command
명령검사 대상
`jstest --normal /dev/input/js0`Joydev 1.x event interface
`jstest --old /dev/input/js0`Joydev 0.x compatibility
`evtest /dev/input/event0`Generic evdev interface

Joydev 세대와 evdev 경로를 각각 시험합니다.

`jstest /dev/input/js0`이 `File not found`를 반환하면 device file이 없는 것이므로 앞의 device node 절에 따라 생성해야 합니다.

Atari·Commodore·Amiga·console의 9-pin D-type Cannon connector joystick을 PC serial port에 직접 연결해서는 안 됩니다. 동작하지 않을 뿐 아니라 serial port 또는 pad를 손상시킵니다.

Quake와 Quake 2는 joystick을 지원하지 않습니다. `joy2key`로 joystick 입력을 keypress로 변환해야 합니다.

FAQ 요약
증상·질문원인·조치
`/dev/input/js0` file not foundDevice node 생성
9-pin pad를 serial port에 직접 연결금지, port·pad 손상 위험
Quake / Quake 2에서 미동작Native 미지원, `joy2key` 사용

증상별 원인과 조치입니다.

Joystick 문제 진단
`/dev/input/js0` 존재 확인`jstest --normal`로 v1.x 확인`jstest --old`로 legacy path 확인`evtest`로 input core event 확인Hardware connector와 driver family 재검토Application 미지원이면 `joy2key` 같은 변환 사용

Node, joydev API, evdev와 application 지원을 순서대로 분리합니다.

Troubleshooting
===============

There is quite a high probability that you run into some problems. For
testing whether the driver works, if in doubt, use the jstest utility in
some of its modes. The most useful modes are "normal" - for the 1.x
interface, and "old" for the "0.x" interface. You run it by typing::

        jstest --normal /dev/input/js0
        jstest --old    /dev/input/js0

Additionally you can do a test with the evtest utility::

        evtest /dev/input/event0

Oh, and read the FAQ! :)

FAQ
===

:Q: Running 'jstest /dev/input/js0' results in "File not found" error. What's the
    cause?
:A: The device files don't exist. Create them (see section 2.2).

:Q: Is it possible to connect my old Atari/Commodore/Amiga/console joystick
    or pad that uses a 9-pin D-type Cannon connector to the serial port of my
    PC?
:A: Yes, it is possible, but it'll burn your serial port or the pad. It
    won't work, of course.

: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
    for them.