Binding keys
in Rust
Binding keys allows you to do one or more actions with a single keystroke.
How to bind keys
Here’s an example to setup a bind to TP you to a home named BASE:
- Press F1 to open console.
- Type: bind F2 chat.say "/home BASE"
- Then type: writecfg
- Now if you press F2 it will TP you to your home named BASE.
This however is only temporary. If you restart Rust, you will lose your bind.
Make it permanent
To make this permanent, you need to edit a file.
- Navigate to your Rust cfg directory. Default install location is C:\Program Files(x86)\Steam\steamapps\common\Rust\cfg
- Open the file ‘keys’ with notepad.
- Find the line for the bind you created. It will look like this: bind f2 "chat.say \"/home BASE\""
- Change it to look like this: bind f2 "chat.say "/home BASE"" – note the pair of double quotes at the end of the command.
- Save the file.
- Now, you MUST right click on your ‘keys’ file and select PROPERTIES. Tick the box that says ‘Read Only’. Click APPLY then click OK.
That’s it
Now everytime you start Rust, the key will be bound. You can skip entering it in console, and just type it in the file directly. If there is already a keybind in the file for the key you want, either delete it, or change it to what you want.
To add multiple commands to a key, separate them with a semicolon (;). For example, to create an AutoRun keybind, in your keys file put: bind numlock "forward;sprint" When you press numlock, you will autorun until you hit Shift W to cancel it.
If you want to create a bind that is only active while you’re holding the key down, use a plus (+). For example: bind numlock "+forward;+sprint"
Bottom line, creating binds in console is perfect for testing them out, but if you want them to be permanent you need to edit the file. So it’s often easier just to put them in the file rather than using console.