Major reworking of key configuration internals.

VControl no longer uses a custom configuration format; instead, control 
bindings are read in from the standard resource system.  Menu controls 
are specified in menu.key in the content; flight controls are now copied 
from uqm.key to flight.cfg instead of from starcon.key to uqm.key.

This change permits significant streamlining of the VControl code 
itself, and allows more fine-grained control over what the key 
configuration code iself does.  This update thus closes both Bug #949 
and Bug #961.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2705 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2007-02-09 07:36:07 +00:00
parent ccc6ddac22
commit e7a86e4a8a
9 changed files with 352 additions and 974 deletions
+83
View File
@@ -0,0 +1,83 @@
# Keyboard control definitions for the menus. 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 controls. Both sets of arrow keys, basically. Paging controls
# moving quickly through the file lists in Super Melee. Zooming
# controls zoom controls in the starmap. "Cancel" is also used to get
# you into menu mode to begin with. There is a "menu.Special" command
# currently unused by the game. It seems to have been originally used
# to call up details on starships in the Super Melee selection screen.
# Arrow key controls...
menu.up.1 = key Up
menu.down.1 = key Down
menu.right.1 = key Right
menu.left.1 = key Left
menu.pageup.1 = key PageUp
menu.pagedown.1 = key PageDown
menu.home.1 = key Home
menu.end.1 = key End
menu.zoomin.1 = key PageUp
menu.zoomout.1 = key PageDown
menu.select.1 = key Return
menu.select.2 = key RightControl
menu.cancel.1 = key Space
menu.cancel.2 = key RightShift
# ... and the number pad. Note that zoom controls on the starmap are
# different from the paging controls in Super Melee.
menu.up.2 = key Keypad-8
menu.down.2 = key Keypad-2
menu.left.2 = key Keypad-4
menu.right.2 = key Keypad-6
menu.pageup.2 = key Keypad-9
menu.pagedown.2 = key Keypad-3
menu.home.2 = key Keypad-7
menu.end.2 = key Keypad-1
menu.zoomin.2 = key Keypad-+
menu.zoomout.2 = key Keypad--
menu.select.3 = key Keypad-Enter
menu.cancel.3 = key Keypad-0
# System utility keys.
menu.delete.1 = key Delete
menu.delete.2 = key Keypad-.
menu.backspace.1 = key Backspace
menu.editcancel.1 = key Escape
menu.search.1 = key /
menu.next.1 = key Tab
menu.pause.1 = key Pause
menu.pause.2 = key F1
menu.exit.1 = key F10
menu.special.1 = key LeftAlt
menu.special.2 = key RightAlt
# Joystick controls, for both port 1 and 2.
menu.up.3 = joystick 0 axis 1 negative
menu.down.3 = joystick 0 axis 1 positive
menu.left.3 = joystick 0 axis 0 negative
menu.right.3 = joystick 0 axis 0 positive
menu.up.4 = joystick 0 hat 0 up
menu.down.4 = joystick 0 hat 0 down
menu.left.4 = joystick 0 hat 0 left
menu.right.4 = joystick 0 hat 0 right
menu.cancel.4 = joystick 0 button 1
menu.select.4 = joystick 0 button 0
menu.up.5 = joystick 1 axis 1 negative
menu.down.5 = joystick 1 axis 1 positive
menu.left.5 = joystick 1 axis 0 negative
menu.right.5 = joystick 1 axis 0 positive
menu.up.6 = joystick 1 hat 0 up
menu.down.6 = joystick 1 hat 0 down
menu.left.6 = joystick 1 hat 0 left
menu.right.6 = joystick 1 hat 0 right
menu.cancel.5 = joystick 1 button 1
menu.select.5 = joystick 1 button 0
-182
View File
@@ -1,182 +0,0 @@
# Default UQM input configuration file.
# This is a VCONTROL version 4 config file (UQM 0.5.3 or later).
version 4
# Keyboard control definitions follow this point. 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 controls. Both sets of arrow keys, basically. Paging controls
# moving quickly through the file lists in Super Melee. Zooming
# controls zoom controls in the starmap. "Cancel" is also used to get
# you into menu mode to begin with. There is a "Menu-Special" command
# currently unused by the game. It seems to have been originally used
# to call up details on starships in the Super Melee selection screen.
# Arrow key controls...
Menu-Up: key Up
Menu-Down: key Down
Menu-Right: key Right
Menu-Left: key Left
Menu-Page-Up: key PageUp
Menu-Page-Down: key PageDown
Menu-Home: key Home
Menu-End: key End
Menu-Zoom-In: key PageUp
Menu-Zoom-Out: key PageDown
Menu-Select: key Return
Menu-Select: key RightControl
Menu-Cancel: key Space
Menu-Cancel: key RightShift
# ... and the number pad. Note that zoom controls on the starmap are
# different from the paging controls in Super Melee.
Menu-Up: key Keypad-8
Menu-Down: key Keypad-2
Menu-Left: key Keypad-4
Menu-Right: key Keypad-6
Menu-Page-Up: key Keypad-9
Menu-Page-Down: key Keypad-3
Menu-Home: key Keypad-7
Menu-End: key Keypad-1
Menu-Zoom-In: key Keypad-+
Menu-Zoom-Out: key Keypad--
Menu-Select: key Keypad-Enter
Menu-Cancel: key Keypad-0
Menu-Delete: key Keypad-.
# System utility keys.
Menu-Delete: key Delete
Menu-Backspace: key Backspace
Menu-Edit-Cancel: key Escape
Menu-Search: key /
Menu-Next: key Tab
Pause: key Pause
Pause: key F1
Exit: key F10
# Arrow-key controls. This is the default for the bottom player in
# Super Melee and the player in the full game. Again, the player has
# the option of using either the number pad or the arrow keys.
Template-1-Up: key Up
Template-1-Down: key Down
Template-1-Left: key Left
Template-1-Right: key Right
Template-1-Weapon: key RightControl
Template-1-Special: key RightShift
Template-1-Up: key Keypad-8
Template-1-Down: key Keypad-2
Template-1-Left: key Keypad-4
Template-1-Right: key Keypad-6
Template-1-Weapon: key Keypad-Enter
Template-1-Special: key Keypad-0
Template-1-Escape: key Escape
# WASD for Player 2's default flight controls. We add the key 'd' to
# let him move down in the super-melee ship selection.
Template-2-Up: key w
Template-2-Down: key s
Template-2-Left: key a
Template-2-Right: key d
Template-2-Weapon: key v
Template-2-Special: key b
Template-2-Escape: key Escape
# Control Scheme 3: Variant Arrow keys with brackets for firing.
Template-3-Up: key Keypad-8
Template-3-Down: key Keypad-2
Template-3-Left: key Keypad-4
Template-3-Right: key Keypad-6
Template-3-Up: key Up
Template-3-Down: key Down
Template-3-Left: key Left
Template-3-Right: key Right
Template-3-Weapon: key ]
Template-3-Special: key [
Template-3-Escape: key Escape
# Control Scheme 4: Shifted WASD keys.
Template-4-Up: key e
Template-4-Down: key d
Template-4-Left: key s
Template-4-Right: key f
Template-4-Weapon: key q
Template-4-Special: key a
Template-4-Escape: key Escape
# This is a sample joystick configuration. This is intended to work
# primarily under WinXP with a USB analog/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. More importantly, it
# gives us a chance to give examples for all of the various input types
# that UQM can handle.
joystick 0 threshold 10000 # How far to move before it counts; 0-30000
Template-5-Up: joystick 0 axis 1 negative
Template-5-Down: joystick 0 axis 1 positive
Template-5-Left: joystick 0 axis 0 negative
Template-5-Right: joystick 0 axis 0 positive
Template-5-Up: joystick 0 hat 0 up
Template-5-Down: joystick 0 hat 0 down
Template-5-Left: joystick 0 hat 0 left
Template-5-Right: joystick 0 hat 0 right
Template-5-Weapon: joystick 0 button 0
Template-5-Special: joystick 0 button 1
Template-5-Escape: key Escape
Menu-Up: joystick 0 axis 1 negative
Menu-Down: joystick 0 axis 1 positive
Menu-Left: joystick 0 axis 0 negative
Menu-Right: joystick 0 axis 0 positive
Menu-Up: joystick 0 hat 0 up
Menu-Down: joystick 0 hat 0 down
Menu-Left: joystick 0 hat 0 left
Menu-Right: joystick 0 hat 0 right
Menu-Cancel: joystick 0 button 1
Menu-Select: joystick 0 button 0
joystick 1 threshold 10000 # How far to move before it counts; 0-30000
Template-6-Up: joystick 1 axis 1 negative
Template-6-Down: joystick 1 axis 1 positive
Template-6-Left: joystick 1 axis 0 negative
Template-6-Right: joystick 1 axis 0 positive
Template-6-Up: joystick 1 hat 0 up
Template-6-Down: joystick 1 hat 0 down
Template-6-Left: joystick 1 hat 0 left
Template-6-Right: joystick 1 hat 0 right
Template-6-Weapon: joystick 1 button 0
Template-6-Special: joystick 1 button 1
Template-6-Escape: key Escape
Menu-Up: joystick 1 axis 1 negative
Menu-Down: joystick 1 axis 1 positive
Menu-Left: joystick 1 axis 0 negative
Menu-Right: joystick 1 axis 0 positive
Menu-Up: joystick 1 hat 0 up
Menu-Down: joystick 1 hat 0 down
Menu-Left: joystick 1 hat 0 left
Menu-Right: joystick 1 hat 0 right
Menu-Cancel: joystick 1 button 1
Menu-Select: joystick 1 button 0
+71
View File
@@ -0,0 +1,71 @@
keys.1.name = Arrows
keys.1.up.1 = key Up
keys.1.down.1 = key Down
keys.1.left.1 = key Left
keys.1.right.1 = key Right
keys.1.weapon.1 = key RightControl
keys.1.special.1 = key RightShift
keys.1.up.2 = key Keypad-8
keys.1.down.2 = key Keypad-2
keys.1.left.2 = key Keypad-4
keys.1.right.2 = key Keypad-6
keys.1.weapon.2 = key Keypad-Enter
keys.1.special.2 = key Keypad-0
keys.1.escape.1 = key Escape
keys.2.name = WASD
keys.2.up.1 = key w
keys.2.down.1 = key s
keys.2.left.1 = key a
keys.2.right.1 = key d
keys.2.weapon.1 = key v
keys.2.special.1 = key b
keys.2.escape.1 = key Escape
keys.3.name = Arrows (2)
keys.3.up.1 = key Up
keys.3.down.1 = key Down
keys.3.left.1 = key Left
keys.3.right.1 = key Right
keys.3.up.2 = key Keypad-8
keys.3.down.2 = key Keypad-2
keys.3.left.2 = key Keypad-4
keys.3.right.2 = key Keypad-6
keys.3.weapon.1 = key ]
keys.3.special.1 = key [
keys.3.escape.1 = key Escape
keys.4.name = ESDF
keys.4.up.1 = key e
keys.4.down.1 = key d
keys.4.left.1 = key s
keys.4.right.1 = key f
keys.4.weapon.1 = key q
keys.4.special.1 = key a
keys.4.escape.1 = key Escape
keys.5.name = Joystick 1
keys.5.up.1 = joystick 0 axis 1 negative
keys.5.down.1 = joystick 0 axis 1 positive
keys.5.left.1 = joystick 0 axis 0 negative
keys.5.right.1 = joystick 0 axis 0 positive
keys.5.up.2 = joystick 0 hat 0 up
keys.5.down.2 = joystick 0 hat 0 down
keys.5.left.2 = joystick 0 hat 0 left
keys.5.right.2 = joystick 0 hat 0 right
keys.5.weapon.1 = joystick 0 button 0
keys.5.special.1 = joystick 0 button 1
keys.5.escape.1 = key Escape
keys.6.name = Joystick 2
keys.6.up.1 = joystick 1 axis 1 negative
keys.6.down.1 = joystick 1 axis 1 positive
keys.6.left.1 = joystick 1 axis 0 negative
keys.6.right.1 = joystick 1 axis 0 positive
keys.6.up.2 = joystick 1 hat 0 up
keys.6.down.2 = joystick 1 hat 0 down
keys.6.left.2 = joystick 1 hat 0 left
keys.6.right.2 = joystick 1 hat 0 right
keys.6.weapon.1 = joystick 1 button 0
keys.6.special.1 = joystick 1 button 1
keys.6.escape.1 = key Escape