Page 1 of 1

Remapping Keybinds

Posted: Sun Feb 11, 2024 6:26 pm
by RoY7x
I posted nearly two years ago in Reddit about looking to simply remap my camera keybinds. Since then I have learned about at least the client/p/ingame.x that basically has all these files to them. When I've tried however going all the way to the //Camera Movement section and tried rebinding these to WASD however, the game will always crash once it tries to load into a map. Is there any way to actually remap these controls? Or am I lost here?

Re: Remapping Keybinds

Posted: Mon Feb 12, 2024 1:54 am
by TommyCD1
Trying it myself seems to work just fine. I thought it might crash, as I've also tried rebinding the arrow keys before only to have it do so, so maybe it's specifically trying to rebind the arrow keys and not camera controls?

Either way, to rebind the camera, first you need to locate the following file.
  • ../client/p/ingame.x
You can find it in your game's directory, which you can locate through Steam or through the game's shortcut used to launch it.

Then you need to extract the contents of the .x file. To do so, you'll need either to use the cmd prompt and use the packer utility, or you can simply use this GUI created by @DavidTheTech which does it for you.
viewtopic.php?t=2827

With the contents extracted, locate the following file inside the extracted ingame folder.
  • if_game_keybind.cfg
The contents of this file contain each keybinding the game has by default. On lines 18 - 22 you'll find the camera controls.

Code: Select all

// Camera movement
BindHold("rightarrow", "camera.bind.right");
BindHold("leftarrow", "camera.bind.left");
BindHold("uparrow", "camera.bind.forward");
BindHold("downarrow", "camera.bind.back");
BindHold assigns a function to a key as hold as it is held. You simply have to change the the parameter in the first set of quotations to your desired key. So for example, to rebind to WASD you can change them to this.

Code: Select all

// Camera movement
BindHold("d", "camera.bind.right");
BindHold("a", "camera.bind.left");
BindHold("w", "camera.bind.forward");
BindHold("s", "camera.bind.back");
Just be sure you don't create conflicting keybinds with anything else. For example, the 's' key is already bound to the "stop order" command further down in the file.

Code: Select all

// Client discrete events
Bind("s", "client.event de::stop");
Bind(",", "client.event de::prevdir");
Bind(".", "client.event de::nextdir");
Bind("shift d", "client.event de::selfdestruct");
Bind("u", "client.event de::upgrade");
Bind("[", "client.event de::prevunit");
Bind("]", "client.event de::nextunit");
Bind("alt [", "client.event de::prevunittype");
Bind("alt ]", "client.event de::nextunittype");
Bind("h", "client.event de::nextunit filter::headquarters");
Bind("e", "client.event de::selectall");
Bind("p", "client.event de::generic::togglepause");
Bind("space", "client.event de::messagejump::last");
Bind("g", "client.event de::selectgroup");
Since this is defined later in the file, this command will overwrite the previous bind for moving the camera.
Key Modifiers can also be applied, like such.

Code: Select all

// Hold the control key
Bind("ctrl 1", "iface.sendnotifyevent Client::SquadManager.Squad1 SquadControl::Create");
// Or the alt key
Bind("alt 1", "iface.sendnotifyevent Client::SquadManager.Squad1 SquadControl::Add");
// Or the shift key
Bind("shift 1", "iface.sendnotifyevent Client::SquadManager.Squad1 SquadControl::JumpTo");
// Combinations also work
Bind("ctrl alt w", "vid.toggle.wireframe;vid.toggle.texture");
Here is a file already created. It rebinds the camera movement to W A S D while leaving the arrow keys unbound. It also disabled the stop command, so you can use it as is or rebind it to something else. To install it, simply place the file into the ingame folder. Repacking the .x archive is not necessary, as the game will see the freestanding .cfg file in the folder and use that over the one that exists in the archive.

Re: Remapping Keybinds

Posted: Thu Feb 15, 2024 11:10 pm
by RoY7x
Thank you so much for taking the time to reply. It's been so long. Have had a blast replaying the whole campaign again, and am now really looking forward to going through great battles with a lil bit more comfortable camera controls. I'm so excited to try this out, and hope to not get any crashes this time around!