Garry's Mod

Garry's Mod

45 ratings
Binding keys; A basic guide to keybinding in Garry's Mod
By Rucksack
Ever wondered how to make those extra keys on your keyboard useful? Here is a guide to binding in gmod!
   
Award
Favorite
Favorited
Unfavorite
Introduction/About
So I am guessing you want to know how to make use of all those other keys on that lovely MAC or PC keyboard you have? Or maybe you want to know how people repeat some chat messages so fast. Well you have come to the right place. This guide will show you how to bind common commands to your open keyboard keys. Keep in mind this is a VERY BASIC GUIDE and for basic use to keep it simple to understand for all users. Not an in-depth guide for everything binding.

Also take note if you are looking to change gameplay keys such as movement, sprint, spray, flashlight ect. this guide will not be of much help you are best changing gameplay keys in your options menu. It is easier and more convenient. This guide will not cover rebinding gameplay based keys that are available in the in game options.

With that out of the way I hope you're ready to find out all of the fun things you can do with that keyboard of yours.

So what can I bind?

You are able to bind just about any command to a key so long as you have the know how. This guide will not give you that, again this is a basic guide intended to simple applications of the binding feature. More complicated key binds such as console commands that rely on variables or different values and are not the "use once to enable and use again to disable" type of toggle commands will require are outside of the scope for this guide. Server related functional commands and more are something you should be careful with and only dive into if you know what you are doing.

Can I only bind one thing per key?

No, you can bind more than one thing to a key at a time. See the Binding Basics for more on that.
Binding Basics
First things first you will need to know how to bind keys. To start open the Gmod console with the ~ key. This should open the pause menu and a window will appear. if you just type bind into the console field with no arguments you will get a message like this; bind [key] <command>: binds a command to a key. this is the command that will bind the key.

Almost all keys on the keyboard work but make sure you do not bind commands to common gameplay keys that you use! (WASD, Shift, alt, ect.). Let's start with a command that will force kill you in the event you are stuck or for whatever reason you need to die and respawn. the command will be for example

bind ] "kill"

] is the key and kill is the command to kill yourself. It is a good idea to put the command in quotations as some are toggles so play it safe and just put all of them in. Now every time you press the ] key without shift alt or another special function key pressed you should die.

If at any point you forget if a key has a bind then in your Gmod console type bind and the key for example if I type in "bind m" it will tell me that I have the ulx menu bound to that key.

Binding multiple commands

It is possible to bind more than one command to a key. To do so your command will look like this:
bind <key> "[command 1] ; [command 2]"

my example: bind home "kill ; say Time to commit the self die"
What this does is, kills me in game if able to do so and sends a chat message on the server wide chat saying Time to commit the self die. Notice I have it in quotation marks, this helps ensure that Gmod knows the start and end of the commands to run. For each command you want bound you will need to have a semicolon between them. that's this little symbol ; the period above the comma NOT a colon or the two periods on top of each other like you've seen used throughout this guide.

UNBINDING COMMANDS

If for whatever reason you need to unbind something then you can do the following command to unbind the key and have it reset to doing nothing: unbind <key>

Remember to rebind it to a new command or input option if you intend on useing the key for something (i.e. accidentally bound something to a movement key and want to go back to default) again for anything that has to do with general gameplay I highly suggest using the in game options menu to change around those keybinds.


Bad Keys

Bad keys are keys that you cannot bind commands, keys that are already in use by the game, keys you may not have on the keyboard and keys that are not recognized by the game. These keys include: end^, home^, insert^, delete^, backspace^, alt, windows/apple key, arrow keys^ and any Function Key beyond F12. While you can bind Function Keys from F1 to F12 and most of these other keys on PC/Windows on Macintosh computers you may run into issues especially with the function keys. Most of these keys are used by the game already or the gamemode. As for using Function Keys if you play common gamemodes like Prop Hunt, DarkRP, TTT and others of the such many use F1, F2, F3 and maybe F4 so avoid binding these to console or other commands. It is also not a good idea to bind any keys that you have in use for game play such as the WASD keys. A good example would be to not dual bind W as your walk forward and a "say LOL" command since you may end up having LOL repeated in chat a lot more than you'd like and might find yourself being banned from servers for spam because of it.


For MAC OS X or OS X Extended keyboard users you CANNOT bind F13 and onward. These keys are not recognized by the game.

Items marked with ^ are keys you can bind but they may not be available on all keyboards or they may be used by your computer for other reasons. Additionally if you have a laptop or "Standard Functions" enabled in your computer settings you will need to hold a key in order to use anything you bind to any of the F keys as they will otherwise do another function like increase or decrease volume, change brightness and so on.

The Keypad


The keypad which is most commonly found on the right side of some keybards holds numbers, symbols commonly used for math, an enter and a clear button. On some keyboards their other function (such as an arrow key or pgup, pgdwn ect.) are listed. In order to bind these you need to know their special function. For example the number 4 on the keypad is known as "kp_leftarrow" in game. To use the keypad follow this list for binding;

1 - kp_end
2 - kp_downarrow
3 - kp_pgdn
4 - kp_leftarrow
5 - kp_5 (yes this is the one exception to the rule)
6 - kp_rightarrow
7 - kp_home
8 - kp_uparrow
9 - kp_pgup
0 - kp_ins
. - kp_del
enter - kp_enter
Chat Binds, say it quick and often!
This is great for server admins or other things that would otherwise require having to type messages quickly. Binding the say command to a key allows you to say a whole chat message at the press of a button! If you are a server admin then this might be useful for some of the messages you have to repeat over and over.

To start like with any other command or bind press the ~ key to open the console. Now we just need to type the bind in. For example:

bind i "say One of these props is not like the others!"

Some servers like mentioned in the introduction have special text things you can use. if you want to bind them learn the text tag and add it into the bind like so:

bind i "say <hsv>One of these props is not like the others!</hsv>"
this can create a rainbow flashing text message.

It is important to keep in mind like with all commands the quotation marks are important! using the tags will require the use of quotation marks otherwise you will run into syntax errors. Also make sure you put a space after the say command and the message you want to be said.

Do not hold the key down when using the bind. Depending how your computer interprets your keyboard repeat you might end up spamming the message and this can get you kicked or banned from just about every good Gmod server as most don't allow spamming the chat.

Watch the length! there is a limit to how many characters you can put into a single chat message. This does not apply in the console so make sure that you do not go over that limit when binding chat messages. They will get cut off at the limit this includes tags such as the <hsv> or other chat based tags, they play into your chat message length so take that into account so you do not have any issues with chat messages being cut off.
Other uses
Key bindings are useful for a whole bunch of other things! Ulx commands, command based menus, all of them can be bound to a key if they have a console command available. In addition if you have a macro pad such as the Razer Tartarus or a gaming mouse like the Razer Naga you can bind those buttons to the buttons you bound to commands for ease of access!

The big thing to remember is that if your command does something drastic you should keep it isolated from other commands as to not have it interfere with your normal gameplay and if you're not 100% sure on a command's effects you shouldn't bind it until you know what it will do. Use common sense when binding things.
ULX Commands
If you are on a server that uses ULX which a lot of servers do then you can bind ULX commands to your keyboard. A good one to start with is to bind the "ulx menu" command. This command brings up the ULX menu and all commands available to you. If you are an admin on a server with ULX this bind should be one you memorize so that you can perform admin actions such as kicking, muting, gaging and banning users for breaking rules. It is not a good idea to bind ULX commands directly since their nature would require you to have one key for every user and inputting a "ulx kick" without any other information may not work.

A good bind location is M so that you can remember 'menu' so you'd want to input your bind as: bind m "ulx menu"

Other ULX commands can be used as well as long as they don't require extra arguments from the command itself (things like a username, Steam ID, location, target ect.) if they require arguments that can be changed then it is best to find it in the ULX menu via the "ulx menu" command or just type it as it should be done in console. if a server has shop and has a way of accessing it via chat say with "!shop" you can use the "say" command bind for this as well. This will allow you to access it at the press of a button. Same thing with most commands that have a chat say ability. However admin commands like ban, kick, banID, banIP or other commands that require arguments like username or steamIDs won't work properly and you will either end up targeting yourself, depending on the command and its settings, or receiving an error.
46 Comments
Rusty Chevrolet Jan 4 @ 11:36am 
like, when i restart gmod, why do they unbind?
Rusty Chevrolet Jan 4 @ 11:35am 
why do my chat binds unbind?
Chikn May 22, 2024 @ 12:45am 
nvm i fixed it
Chikn May 22, 2024 @ 12:41am 
i may or may not have unbinded my mouse 2.. now my phys gun wont freeze stuff
Gleordex0 Mar 28, 2024 @ 9:27pm 
nvm figured it out :p
Gleordex0 Mar 28, 2024 @ 9:22pm 
How do I bind primary fire to =? I have no idea how to, I've been trying, and I've given up on
bind = Primary attack bind = "Primary_attack
I'm confused :/
7H3_HuN73R-03 Dec 30, 2023 @ 5:31pm 
how do I made two keys do only one thing and when a key most be pressed n times to do a command
PILL Dec 11, 2023 @ 3:09am 
nvm
PILL Dec 11, 2023 @ 3:05am 
what happens if you bound e to a chat command and cant interact anymore whats he command to fix that asking for a "friend"
Rucksack  [author] Sep 2, 2023 @ 1:19am 
@HITTHERE Arrow keys are listed because some, though very few, keyboards do not have them. I forgot to add the annotation for them.