Completely reworked the input system.

The 3DO-controller model has been replaced with a general "game-control"
listener that checks for values like menu-left or p1-thrust.  Key
configuration is completely different now; see starcon.key for ways to
control it, or delete your old keys.cfg and let it automatically
generate a default.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@978 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2003-06-16 01:26:10 +00:00
parent 0f5ff09da6
commit 8a6ad0ddba
55 changed files with 2786 additions and 1712 deletions
+101 -88
View File
@@ -1,88 +1,101 @@
# File format:
# Three lines for Pause Key, Exit Key, Abort Key
# 10 lines for player 1, 10 lines for player 2 in the following order:
# Left, Right, Up, Down, Button 1, Button 2, Button 3, Button 4,
# Left Shift, Right Shift
#
# Each player's key listing can begin with an optional joystick declaration
# of the format:
# <JoyportX-thresholdT> where X is the joystick port (0-based) and T is the
# threshold. Digital pads can use a threshold of 0, but analog joysticks
# may need a non-zero threshold to handle jittering
#
# Lines beginning with a '#' are ignored
# Each line contains one or two entries
# The first entry must be a keyboard key, enclosed in quotes
# Use "Up" for up arrow, "Down" for down arrow, etc.
# You can chord keys together like this: "F2,F3"
# The second entry, if present, will be separated from the first entry by a
# space. It represents a joystick button press / axis motion
# The format for joystick button presses is
# <Joy-Bn> where n is the button number
# The format for joystick axis movement is
# <Joy-An+> or <Joy-An-> where n is the axis number, and the
# + or - represents the direction of movement
# You can combine two joystick button presses with
# <Joy-Cn,m> where n and m are button numbers
# ----------------------------------------------------------------------------
#
# Pause
"F1"
# Exit
"F10"
# Abort
"F12"
#
# Player 1 (keyboard only)
#
"Left"
"Right"
"Up"
"Down"
"Enter"
" "
"RCtrl"
"Esc"
"LShift"
"RShift"
#
# Example Player 1 (for a 2-axis, 2-button joypad)
#
#<Joyport0-threshold0>
#"Left" <Joy-A0->
#"Right" <Joy-A0+>
#"Up" <Joy-A1->
#"Down" <Joy-A1+>
#"Enter" <Joy-B0>
#" " <Joy-B1>
#"RCtrl" <Joy-C0,1>
#"Esc"
#"LShift"
#"RShift"
#
# Example Player 1 (for a gravis xterminator)
#
#<Joyport0-threshold2185>
#"Left" <Joy-A7->
#"Right" <Joy-A7+>
#"Up" <Joy-A8->
#"Down" <Joy-A8+>
#"Enter" <Joy-B2>
#" " <Joy-B3>
#"RCtrl" <Joy-B4>
#"Esc"
#"LShift" <Joy-B0>
#"RShift" <Joy-B1>
#
# Player 2 (keyboard only)
#
"s"
"f"
"e"
"d"
"w"
"q"
"a"
""
""
""
# Sample UQM input configuration file. This file may replace the
# automatically generated keys.cfg if you wish; there is no difference
# in behavior. This one just has more comments in it.
# This is the actual key configuration. Most keys can be described in
# a straightforward manner; consult the name table in
# src/sc2code/libs/input/sdl/keynames.c for the names of unusual keys.
# Most keys can be named by just the symbol they produce.
Menu-Select: key Return
Player-1-Thrust: key Return
Lander-Thrust: key Return
Player-1-Escape: key Escape
Lander-Escape: key Escape
Menu-Cancel: key Space
Player-1-Weapon: key Space
Lander-Weapon: key Space
Player-2-Left: key a
Player-2-Right: key d
Player-2-Weapon: key t
Player-2-Thrust: key w
Player-2-Special: key y
Menu-Down: key Keypad-2
Menu-Page-Down: key Keypad-3
Menu-Left: key Keypad-4
Player-1-Left: key Keypad-4
Lander-Left: key Keypad-4
Menu-Right: key Keypad-6
Player-1-Right: key Keypad-6
Lander-Right: key Keypad-6
Menu-Up: key Keypad-8
Player-1-Thrust: key Keypad-8
Lander-Thrust: key Keypad-8
Menu-Page-Up: key Keypad-9
Menu-Zoom-Out: key Keypad--
Menu-Zoom-In: key Keypad-+
Menu-Select: key Keypad-Enter
Player-1-Thrust: key Keypad-Enter
Lander-Thrust: key Keypad-Enter
Menu-Up: key Up
Player-1-Thrust: key Up
Lander-Thrust: key Up
Menu-Down: key Down
Menu-Right: key Right
Player-1-Right: key Right
Lander-Right: key Right
Menu-Left: key Left
Player-1-Left: key Left
Lander-Left: key Left
Menu-Page-Up: key PageUp
Menu-Zoom-In: key PageUp
Menu-Page-Down: key PageDown
Menu-Zoom-Out: key PageDown
Pause: key F1
Exit: key F10
Abort: key F12
Player-1-Weapon: key RightShift
Lander-Weapon: key RightShift
Player-1-Special: key RightControl
# This is a sample joystick configuration. This is intended to work
# primarily under WinXP with a USB analag/digital gamepad. The
# digital aspect of the gamepad happens to present itself to the
# system as a POV hat. This configuration allows either the digital
# or analog stick to be used simultaneously.
# joystick 0 threshold 10000 # How far to move before it counts; 0-30000
# Menu-Left: joystick 0 axis 0 negative
# Player-1-Left: joystick 0 axis 0 negative
# Lander-Left: joystick 0 axis 0 negative
# Menu-Right: joystick 0 axis 0 positive
# Player-1-Right: joystick 0 axis 0 positive
# Lander-Right: joystick 0 axis 0 positive
# Menu-Up: joystick 0 axis 1 negative
# Player-1-Thrust: joystick 0 axis 1 negative
# Lander-Thrust: joystick 0 axis 1 negative
# Menu-Down: joystick 0 axis 1 positive
# Menu-Cancel: joystick 0 button 0
# Player-1-Special: joystick 0 button 0
# Menu-Select: joystick 0 button 1
# Player-1-Weapon: joystick 0 button 1
# Lander-Weapon: joystick 0 button 1
# Menu-Page-Up: joystick 0 button 4
# Menu-Page-Down: joystick 0 button 5
# Menu-Zoom-In: joystick 0 button 6
# Player-1-Escape: joystick 0 button 6
# Lander-Escape: joystick 0 button 6
# Menu-Zoom-Out: joystick 0 button 7
# And now the POV hat controls.
# Menu-Left: joystick 0 hat 0 left
# Player-1-Left: joystick 0 hat 0 left
# Lander-Left: joystick 0 hat 0 left
# Menu-Right: joystick 0 hat 0 right
# Player-1-Right: joystick 0 hat 0 right
# Lander-Right: joystick 0 hat 0 right
# Menu-Up: joystick 0 hat 0 up
# Player-1-Thrust: joystick 0 hat 0 up
# Lander-Thrust: joystick 0 hat 0 up
# Menu-Down: joystick 0 hat 0 down