The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: Joseph Collins on August 26, 2016, 04:28:48 pm



Title: [UQM] Disabling Gamepad OR Editing Menu Controls? **SOLVED**
Post by: Joseph Collins on August 26, 2016, 04:28:48 pm
Wow.  It's been some time since I've been here.  Kind of surprised my account still works...  But anyway, let's get to the point of the topic.

I like to play The Ur-Quan Masters using a controller.  Specifically, a PlayStation 2 Dual Shock controller.  Now, the way I do this is by using a third-party adapter that maps the buttons to DirectInput (I think?).  It works perfectly, but there's just one problem...  The buttons are mapped in a very specific order from 0 to 11:
/\, O, X, [¯], L2, R2, L1, R1, Start, Select, L3, R3

Bearing that in mind, The Ur-Quan Masters tends to automatically detect your controllers and, like all programs that acknowledge your game controller, maps buttons automatically without your input.  With the case of The Ur-Quan Masters, it automatically maps Confirm to Button 0 and Cancel to Button 1.  As you may have guessed, that means I need to press /\ or O to navigate the menus... and I've always found that kind of inconvenient, not to mention mildly baffling, considering you can change your flight controls to suit your tastes, or even remove flight controls altogether! (Not sure why you'd ever want to do this, though...)

So, with all that being said, I was wondering if there was a way to either disable the game from using detecting and controllers so I can just use JoyToKey and the like... or much more preferably, a way to set the menu navigation buttons exactly how I want them.

Thanks in advance!


Title: Re: [UQM] Disabling Gamepad OR Editing Menu Controls? **SOLVED**
Post by: Joseph Collins on August 31, 2016, 02:17:22 am
Feel free to merge this post with the above, whomever's in-charge.

So, I kinda stumbled upon the solution myself while looking for something entirely unrelated.

As of The Ur-Quan Masters v0.7.0, controls are separated into different files.  "flight.cfg" is, as you might have guessed, the flight controls.  At a glance, there is no option or file to change the menu controls like there was in v0.6.x and earlier.  However, there is still a way, as pointed-out by Novus five years ago:
I can't find any documentation, so I'll give a brief explanation.

Basically, override.cfg is an extension to menu.key (https://sourceforge.net/p/sc2/code/HEAD/tree/trunk/sc2/content/menu.key) and uses the same syntax. Basically, the format is:

<function name>.<definition number> = STRING:key <key name>

  • <function name> is what you want the key to do; look for the corresponding function in menu.key.
  • <definition number> is the number of the binding you want to change; you can bind several keys to the same function by giving them consecutive numbers. So, to add a binding like in the example, you use a definition number larger than the highest one used so far (in both menu.key and override.cfg). To change a previously defined key, use the same number.
  • <key name> is the name of the key you want to assign; for a list, see src/libs/input/sdl/keynames.c. (https://sourceforge.net/p/sc2/code/HEAD/tree/trunk/sc2/src/libs/input/sdl/keynames.c)

Sooo... undocumented in this version, but still there.  I am A-OK with that.

Thanks, Novus from August 28th, 2011!

Edit: For the curious, I basically just wanted to swap Button 0 and Button 1 (so 1 = Confirm and 0 = Cancel/Menu), since that's how I have JoyToKey set for the MS-DOS version.


Title: Re: [UQM] Disabling Gamepad OR Editing Menu Controls? **SOLVED**
Post by: Death 999 on September 01, 2016, 03:56:56 am
Glad you worked it out!