Most players are familiar with the keyboard shortcuts to lock your guns on a particular bearing (Ctrl+X) or sector (Space+X). And these commands are real handy at times. But what if you're not real deft with the keyboard (like me) and want to assign those commands to different keys or mouse buttons. Unfortunately, there's no option for it in the Settings>Controls screen. So you must do it manually by editing the preferences.xml file. Here I'll show you how. But please be careful, and if you don't understand something, ASK. Because if you screw something up, well, you know the rest...
1. BACKUP YOUR preferences.xml FILE. Now open your preferences.xml file in your favorite text editor (I like wordpad).
2. Press Ctrl+F (find) and look for <commands>. It should appear near the bottom of the file. If it does, go to step 3. If not, then you've never altered a command. So do the following:
2a) Close the text editor and start up the game.
2b) Go to Settings>Controls and add a harmless key command. Example: assign the O key as the secondary key (right box) to the Reload Torpedo Tube command.
2c) Apply the command and exit the game. Start at step 1 again and you should now see the <command> section in step 2.
3. Next you must insert code into the <commands> section. Notice further down, there's a line that reads </commands>. This is the END of the section. If you have other keys reassigned or added, the code is inserted in blocks of code starting with the command name (like <CMD_TORPEDO_RELOAD) and ends with /command name (like </CMD_TORPEDO_RELOAD), (Note the forwardslash at the start of the ending command). You must insert code in it's own separate block. Between the end of one block and before the start of the next block.
4. To reassign a key/button for the Locked On Bearing command, insert this block of code:
Note that this will assign the command to the Mouse4 button. If you want a different key, replace the MOUSE4 with your desired key (Example "KEY_O" or "KEY_RBRACKET").
5. To reassign a key/button for the Locked On Sector command, insert this block of code:
Note that this will assign the command to the Mouse5 button. If you want a different key, replace the MOUSE5 with your desired key (Example "KEY_P" or "KEY_LBRACKET").
6. Save the file and start the game. If you screwed something up, the game will either crash or start and rep[lace the preferences.xml with the default one. In either event redo the process.
Options: The code inserts will assign a secondary key to the commands. So the Ctrl+X and Shift+X keys will still work. If you want to replace the original key commands, change the index line from "1" to "0". If you want a key combo (a key pressed along with the ALT, CTRL or Shift key), insert that key name (KEY_LALT, KEY_LCONTROL, or KEY_LSHIFT) inside the quotes of the mods line (Example mods="KEY_LALT")
If there's a part you don't understand or you think needs clarification, don't hesitate to ask.