How to bind mouse buttons in CS GO console?

Basically I want to bind my Mouse 4 button to TOGGLE on and off the voice chat in game. I know how to start it (Bindtoggle) but I don't know the correct name for mouse 5 in console as well as how to get it to change voice chat. Silly question but should be easy to answer I guess.


Solution 1:

Adding onto what Codingale said, your mouse doesn't have any special name. There is mouse1-3 if you have a scroll wheel, and I have seen some that go all the way to 7.

You also stated that you would like it to where you can disable voice chat and reenable it with your mouse. Are you talking about, pressing the binded button and being able to talk, or turning off voice chat completely.

If the first option, Codingale was correct. It is +voicerecord.

If the second option, look at this:

voice_enable 0 - Voices off
voice_enable 1 - Voices on

So, say you had a mouse that had 5 buttons. You could run something like this in console, or make an autoexec to run it as soon as the game starts.

bind "mouse4" "voice_enable 0"
bind "mouse5" "voice_enable 1"

And then you can alternate between pressing those as you see fit :D

Or combine the two into one and use;

    bind "del" "toggle voice_enable 0 1" 

Pressing delete will turn voices off, press it again and it will turn them on again.

And you can also turn voices up and down by using this command:

voice_scale 1 - Default
voice_scale .5 - More Tolerable
voice_scale 0 - Voice volume muted

Source

Solution 2:

You can use Mouse4 (or Mouse5) as the button. Mouse1 is left button, Mouse2 is right and Mouse3 is the middle mouse button.

See this post where someone asked a similar question.

bind "Mouse4" <command> works, and the voice chat is +voicerecord

If this doesn't work try editing a bind and the pressing the button it asks and type in host_writeconfig and you should be able to view the config.cfg and find it.

Solution 3:

Really it depends on your mouse, I have a Razer Naga mouse that has mouse1-5, then had 12 more buttons that act as either the keypad buttons or the 1-0,_,= at the top of my keyboard.

My thought would be to figure out how your buttons work, if they are mouse4, mouse5, etc. or kp_end, or other keypad functions, then bind out with the commands listed by the other answers.