Forts
Not enough ratings
Custom Key Bindings
By EarthWork Games and 1 collaborators
How to modify the default key mapping in Forts.
   
Award
Favorite
Favorited
Unfavorite
In-game key rebinding
Forts was updated post-launch with in-game key rebinding. To use this feature, go to the Options screen in the main menu, then Input. The first tab allows you to edit the most commonly used keys, the second tab lists all keys.

To change a key binding, click on it and press the new key. A warning will appear if the key is used for another action. This isn't necessarily a problem - it depends if they are in effect at the same time. You can reset a specific key to the default, or reset all keys to the defaults too.

To manually edit the key bindings, see the following sections.
Creating and editing keys.lua
1. Open up Forts/data/mods/keyboard-AZERTY/keys.lua.
2. Copy that into your Forts/users/<user> folder, so it's next to settings.lua
3. The names of the available key functions can be found in Forts/data/mods/language-English/db/strings.lua, starting at "ToggleConsole" and ending at "SelectItem9". Some of these are not functional yet.
4. The available keys to bind to can be found in Forts/data/ui/dik_codes.lua
5. Edit the copied keys.lua to change the key bindings. You can delete the comments at the top.
Example
For example, if you wanted to change the pan keys to be the arrow keys instead of WASD (or equivalent):

Keys =
{
PanUp = { DIK_UP, },
PanDown = { DIK_DOWN, },
PanLeft = { DIK_LEFT, },
PanRight = { DIK_RIGHT, },
}
Modifiers
You can also apply key modifiers like so:

Keys =
{
RepairArea = { DIK_R, Ctrl | Shift | Alt },
}
11 Comments
[DEV] BeeMan  [author] 6 Jun, 2019 @ 9:55pm 
@SZzzzzz sorry we missed your question. It looks like there was a bug. I'll check it out.
SZzzzzz 29 Sep, 2018 @ 10:02am 
Hello Kind Sir, I've met the problem with impossibility to save changes in the game controls (after each restart / or maybe even during the game - the controls get reset to default), but thank you for this guide - it works for me .. but partially.

I've put next config file - but ToggleGIFCapture is not working - I need to switch this off completely.
I've tried to put
ToggleGIFCapture = {},
as well
ToggleGIFCapture = {,},
and the final varian even this one
ToggleGIFCapture = {DIK_F11, Alt},
- nope it doesn't work, i.e. standard combination Alt+G still survives all my tries.

Any ideas about:
1) why standard binding returns during the game?
2) why changed via Config -> Input setting are not permanent?
3) how to switch off this crazy GIFCapture (this just hang the app, this why I don't need that at all)?
EarthWork Games  [author] 4 Jul, 2017 @ 3:46am 
It's RepairArea, as in the example given in the Modifiers section.
BENTON!!! 3 Jul, 2017 @ 2:45pm 
what about changing the repair key?
Faust 19 May, 2017 @ 6:54pm 
Thanks
EarthWork Games  [author] 19 May, 2017 @ 3:39pm 
FireWeapon :)
Nco 15 May, 2017 @ 5:34am 
Same problem Faust
Faust 8 May, 2017 @ 10:55pm 
Hi, i know there s a key to repeat the fire on a group of weapon and i know it's mapped on "e" by default but i don't really know which function it is in the string.lua.
Can you help me there please ?
Thanks for the guide
EarthWork Games  [author] 26 Apr, 2017 @ 7:12am 
Hi Wensaan, only the last one would take effect. Let me know if you want any duplicate actions.

Yeah PushToTalk is non-functional atm.
wensaan 26 Apr, 2017 @ 6:32am 
Thanks for that! commands SaveScreen and RestoreScreen are what I was looking for ;)

Hava a question tho. Is it possible to bind two different keys to do same action? Tryed, didnt work.

Guess command PushToTalk doesnt work, does it? Didnt try this one, but you already mentioned this is something from to-do list.

cheers
W