The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: MadFrog on December 14, 2006, 11:56:51 pm



Title: keys.cfg help
Post by: MadFrog on December 14, 2006, 11:56:51 pm
I'm using the xbox port of the game on my avalaunch browser, and everything works fine except super melee mode. It seems like the developers decided never to finish, and the first controller controls both ships in super melee mode. This is how my keys.cfg looks now, and I would like to configure it so that the two xbox controllers contorl their own ship. Don't care about joystick or d-pad, i'm flexible, or what buttons accelerate, fire, and secondary fire as long as their all functional. If someone could show me how to do it or do it for me I would appreciate it, thanks.
# Default UQM input configuration file.

# This is a VCONTROL version 1 config file (UQM 0.3 or later).
version 1

# 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-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
Menu-Delete: key Delete

# ... 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-Zoom-In: key Keypad-+
Menu-Zoom-Out: key Keypad--
Menu-Select: key Keypad-Enter
Menu-Cancel: key Keypad-0
Menu-Delete: key Keypad-.

# Player 1's flight controls.  This is 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.

Player-1-Thrust: key Up
Player-1-Left: key Left
Player-1-Right: key Right
Player-1-Weapon: key Return
Player-1-Weapon: key RightControl
Player-1-Special: key RightShift
Player-1-Escape: key Escape

Player-1-Thrust: key Keypad-8
Player-1-Left: key Keypad-4
Player-1-Right: key Keypad-6
Player-1-Weapon: key Keypad-Enter
Player-1-Special: key Keypad-0

Player-1-Weapon: key ]
Player-1-Special: key [

# Lander controls.  These map mostly to Player 1's controls.

Lander-Thrust: key Up
Lander-Left: key Left
Lander-Right: key Right
Lander-Weapon: key Return
Lander-Weapon: key RightControl
Lander-Escape: key RightShift
Lander-Escape: key Space

Lander-Thrust: key Keypad-8
Lander-Left: key Keypad-4
Lander-Right: key Keypad-6
Lander-Weapon: key Keypad-Enter
Lander-Escape: key Keypad-0

Lander-Weapon: key ]
Lander-Escape: key [
Lander-Escape: key Escape

# Player 2's flight controls.  We add the key 'd' to let him
# move down in the super-melee ship selection.
Player-2-Thrust: key e
Player-2-Left: key s
Player-2-Right: key f
Player-2-Down: key d
Player-2-Weapon: key q
Player-2-Special: key a

# System utility keys.
Pause: key Pause
Pause: key F1
Exit: key F10

# 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 2000   # 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 1
Player-1-Special: joystick 0 button 1
Menu-Select: joystick 0 button 0
Player-1-Weapon: joystick 0 button 0
Lander-Weapon: joystick 0 button 0
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 2
Lander-Escape: joystick 0 button 2
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

# Second joystick
joystick 1 threshold 2000   # How far to move before it counts; 0-30000
Menu-Left: joystick 1 axis 0 negative
Player-1-Left: joystick 1 axis 0 negative
Lander-Left: joystick 1 axis 0 negative
Menu-Right: joystick 1 axis 0 positive
Player-1-Right: joystick 1 axis 0 positive
Lander-Right: joystick 1 axis 0 positive
Menu-Up: joystick 1 axis 1 negative
Player-1-Thrust: joystick 1 axis 1 negative
Lander-Thrust: joystick 1 axis 1 negative
Menu-Down: joystick 1 axis 1 positive
Menu-Cancel: joystick 1 button 1
Player-1-Special: joystick 1 button 1
Menu-Select: joystick 1 button 0
Player-1-Weapon: joystick 1 button 0
Lander-Weapon: joystick 1 button 0
Menu-Page-Up: joystick 1 button 4
Menu-Page-Down: joystick 1 button 5
Menu-Zoom-In: joystick 1 button 6
Player-1-Escape: joystick 1 button 2
Lander-Escape: joystick 1 button 2
Menu-Zoom-Out: joystick 1 button 7

# POV hat controls for the second joystick
Menu-Left: joystick 1 hat 0 left
Player-1-Left: joystick 1 hat 0 left
Lander-Left: joystick 1 hat 0 left
Menu-Right: joystick 1 hat 0 right
Player-1-Right: joystick 1 hat 0 right
Lander-Right: joystick 1 hat 0 right
Menu-Up: joystick 1 hat 0 up
Player-1-Thrust: joystick 1 hat 0 up
Lander-Thrust: joystick 1 hat 0 up
Menu-Down: joystick 1 hat 0 down



Title: Re: keys.cfg help
Post by: meep-eep on December 15, 2006, 01:35:30 am
Even though I don't see it in the ChangeLog, I think this is a bug that has been fixed. I suggest you try the most recent CVS snapshot (http://uqm.stack.nl/files/snapshots). Don't forget to install the content update too.


Title: Re: keys.cfg help
Post by: MadFrog on December 15, 2006, 06:54:30 am
Bear in mind I'm using an xbox modified version, not your regular release. I'm not sure how I'd bo about using the most recent snapshot. If anyone knows alot about keymapping on an xbox I'd love to know what the xbox controller's movements stand for in assembly terms.


Title: Re: keys.cfg help
Post by: Michael Martin on December 21, 2006, 08:03:45 am
For that specific version of keys.cfg,  take all the references to "joystick 1" on the right-hand side of the colon and "Player-1" on the left-hand side and change the "Player-1" to "Player-2".  I think that should cover it.

UQM is written (almost) entirely in C, and only touches assembler when it's doing graphics scaling.  All I/O is handled via the SDL libraries, which we don't deal with at all.  I suspect the Xbox's input regime looks a lot like DirectX's DirectInput libraries, though.


Title: Re: keys.cfg help
Post by: meep-eep on December 21, 2006, 08:12:12 am
All I/O is handled via the SDL libraries
Except file I/O.