This commit is contained in:
Wintermute0110 2014-11-22 01:29:58 +09:00
parent 57b67ffc86
commit 854146bdcf

View file

@ -1,13 +1,13 @@
This file documents the use of a joystick/gamepad under Linux in RBDoom3-BFG.
This file documents the use of a joystick/gamepad under Linux with RBDoom3-BFG.
Joystick support has been tested with an XBox 360 wireless and a
Logitech F710 wireless gamepads, but in theory should work with any XBox 360
compatible gamepad, either wireless or wired/USB.
To use the gamepad follow this instructions,
a) Make sure your joystick is detected and usable by RBDoom3-BFG.
a) Make sure your joystick is detected by Linux.
One way to check this is to look for the jsN files under /dev/input/, where
One way to check this is to look for jsN files under /dev/input/, where
N is a number. For example, /dev/input/js0 is the first joystick,
/dev/input/js1 the second one, and so on. Executing the following command you
should see something like this:
@ -15,8 +15,8 @@ should see something like this:
$ ls -l /dev/input/js*
crw-rw-r--+ 1 root input 13, 0 Nov 20 04:39 /dev/input/js0
Another way is to used the udevadm monitor command. This is what happens when
you connect a USB joystick (launch udevadm and then connect the gamepad or
Another way to check is to use the udevadm monitor command. This is what happens
when you connect a USB joystick (launch udevadm and then connect the gamepad or
the wireless receiver):
$ udevadm monitor -u
@ -29,7 +29,7 @@ the wireless receiver):
UDEV [14504.555805] add /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/input/input22/event19 (input)
UDEV [14504.565611] add /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/input/input22/js0 (input)
The program jstest will allow you to check if your joystick works OK:
The program jstest allows you to check if your joystick works OK:
$ jstest /dev/input/js0
Driver version is 2.1.0.
@ -45,7 +45,7 @@ joystick named /dev/input/js0.
b) Make sure RBDoom3-BFG detects and is able to use your joystick.
Execute RBDoom3-BFG in a console to see the messages printed there. If
Execute RBDoom3-BFG in a console/terminal to see the messages printed there. If
your joystick is correctly detected you should see something like this:
$ ./RBDoom3BFG
@ -70,13 +70,15 @@ your joystick is correctly detected you should see something like this:
If the number of detected joysticks is 0 and none is opened check again
a) and make sure the file /dev/input/js0 is there (for example, if you
are using a wireless joystick make sure the gamepad is ON and not
in sleeping mode when you run RBDoom3-BFG).
in sleeping mode when you run RBDoom3-BFG) and that you have permissions
to read that file (for example, in Debian users that want to use the
joystick must be added to the group input).
c) Set the bindings of your joystick.
You can use the Doom3 console to set the bindings. To bind a joystick
button/axis to a game action, press the tilde key to show the Doom3
console. Then type:
You can use the Doom3 console to set the bindings. To bind a joystick
button/axis to a game action, press the tilde key (just below ESC) to
show the Doom3 console. Then type:
] bind <key_name> <action>
@ -87,9 +89,9 @@ For example, this binds gamepad button 0 with the action "jump":
Apendix A gives you a list of the gamepad axis/button names and the
possible actions you can bind to them.
Alternatively, you can use configuration files to set this bindings
Alternatively, you can use configuration files to set the bindings
automatically. Copy the files joy_righty.cfg, joy_lefty.cfg and joy_360_0.cfg
to your Doom3 base directory. You can find this files in Appendix B at the
to your Doom3 base directory. You can find these files in Appendix B at the
bottom of this file.
d) Enjoy!
@ -99,18 +101,18 @@ TODO/BUGS
* Only XBox 360 gamepad clones are supported at the moment.
* SDL axis/keycodes are hard-coded. Depending of your gamepad model maybe
this will produce unwanted results. It is not clear at the moment how
to remap this (configuration file, GUI, ...).
* SDL axis/keycode numbers are hard-coded to Doom3 axis/keycode names.
Depending of your gamepad model maybe this will produce unwanted results.
It is not clear at the moment how to remap this (configuration file, GUI, ...).
--------------------------------------------------------------------------
Apendix A) Doom3 joystick key names and key bindings
This is a list of the supported key/axis names. Note that the names of the
buttons are only valid for the XBox 360 wireless gamepad. Other gamepads
will have different names depending on the gamepad layout. Other gamepads
may have more buttons available so you can map more actions. Also note that
RBDoom3-BFG treats the back triggers like buttons rather that an axes.
may have different names depending on the gamepad layout and/or more buttons
available so you can map more actions. Also note that RBDoom3-BFG treats
the back triggers like buttons rather that axes.
JOY1 (A button)
JOY2 (B/Circle button)
@ -141,8 +143,9 @@ JOY_STICK2_DOWN (LEFT ANALOG JOYSTIC DOWN)
JOY_STICK2_LEFT (LEFT ANALOG JOYSTIC LEFT)
JOY_STICK2_RIGHT (LEFT ANALOG JOYSTIC RIGHT)
This is a list of commands in Doom3. Note that commands that have
spaces must be quoted "":
This is a list of commands that can be binded in Doom3. This commands are
only valid in-game, the GUI uses its own set of hard-coded key bindings. Note
that commands having spaces in between (more than one word) must be quoted "":
_impulse0 Fists / Grabber
_impulse2 Pistol
@ -163,6 +166,7 @@ _impulse19 PDA / Scoreboard
_attack Fire / Melee
_use Use / Action
_speed Run
_forward Move forward
_back Move backwards
_moveleft Move left
@ -206,7 +210,7 @@ bind "JOY_STICK1_RIGHT" "_right"
-- joy_360_0.cfg ---------------------------------------------------------
bind "JOY_DPAD_RIGHT" "_impulse5" // Put your favourite weapons here
bind "JOY_DPAD_LEFT" "_impulse12"
bind "JOY_DPAD_LEFT" "_impulse12" // for quick access.
bind "JOY_DPAD_UP" "_impulse6"
bind "JOY_DPAD_DOWN" "_impulse8"