Tweezer's Half-Life Health Club
Tweezer's Half-Life Health Club™

Customizing Mouse Buttons

CDNOW
Previous page Next Page
Prev Next
On This Page
Visit the rest of . Click on the links below...
Other Resources
Command Center
An excellent reference for the syntax of the configuration file (and much more).
TweezerTip™:
Mouse Buttons
Here is a quick summary of how I set my mouse buttons.

Using any text editor, change valve\config.cfg to include these lines:

bind "MOUSE3" "lastinv"
bind "MOUSE4" "use weapon_crowbar"
bind "MOUSE5" "use weapon_shotgun"
bind "MWHEELDOWN" "invnext"
bind "MWHEELUP" "invprev"
TweezerTip™:
Where to Get Half-Life
Half-Life isn't free; you need to buy it. Internet play requires a CD Key number, which only comes with a Half-Life CD. You can't really share CD Keys because they are authenticated before you begin an internet game.


For "deathmatch" play you need either the Half-Life: Game of the Year Edition (now bundled with the Opposing Force expansion and sold as the Half-Life: Adrenaline Pack), or the new Half-Life Counter-Strike release (below).


If you are serious, you'll want both. You can save quite a bit of money by getting the complete set, newly bundled as the Half-Life Platinum Edition.


For more information see .
Sale! 30% Off Grammy Award Winners
Donations help support this site.

Why Customize Mouse Buttons?

You come around a corridor only to find an opponent looking the other direction or out a window. It's a perfect chance to sneak up and whack them with the crowbar! You creep up behind them and reach for the "1" key, but instead of a crowbar you hit the "q" key. Or, worse, the "~" and bring down the console. Next thing you know, you're dead.

If only there were a fast and reliable way to grab that crowbar every time...

Well, if you have a mouse with more than two buttons, there is! In the section below I'll show you how to bind mouse buttons to Half-Life game actions such as "use the crowbar".

The standard Half-Life configuration assigns mouse buttons 1 and 2 to "fire" and "secondary fire", respectively. But three-button mice have been common for years, and nowadays it's very common to have five buttons plus a wheel. Don't let those buttons go to waste. Use of the wheel is configured by default in current Half-Life versions, but you have to do a little work to take advantage of mouse buttons 3, 4, and 5.

iconMicrosoft Intellimouse Optical
Microsoft Intellimouse Optical (D58-00002)
Pressing down on the wheel gives you Button 3.

I currently use the Microsoft Intellimouse Optical shown above and have been very pleased with it. Some sources incorrectly describe this as a "2 button" mouse. If in doubt, check the part number: D58-00002 is the 5-button mouse shown above.

My opinion is that the more-expensive Microsoft optical Intellimouse Explorer is an inferior choice for game play. The Intellimouse Explorer is an asymmetrical "right-handed" mouse (I've never seen a left version) with buttons 4 and 5 both located on its left-hand side, for operation by your right thumb.

How To Set Half-Life Mouse Button Bindings

First, here is the basic information you need to know about how your Half-Life game configuration can be modified.

  • Key and button bindings are set in the text file config.cfg which lives in your Half-Life\valve\ directory. You can edit it with your favorite text editor. Notepad works fine.
  • Inside config.cfg, the syntax for binding an action to a key event is
  • bind eventname action
  • The eventnames for the mouse button-press events are MOUSE1, MOUSE2, MOUSE3, MOUSE4, MOUSE5. The wheel events are named MWHEELDOWN and MWHEELUP
  • Everything you can do in Half-Life is an action. The particular ones we need to look at are
    use item
    Uses an item or weapon. Weapons all have names such as "weapon_crowbar" (see list at right in sidebar).
    lastinv
    Toggle between the two most recently used "inventory items". For our purposes, that just means switching between the last two weapons. lastinv is normally bound to the "q" key.
    invnext
    Select the next inventory item (i.e. weapon). invnext is normally bound to the "]" key.
    invprev
    Select the previous inventory item. invprev is normally bound to the "[" key.
    +reload
    Reload the current weapon. Normally bound to the "r" key.
    +attack
    Fire weapon. Normally bound to mouse button 1.
    +attack2
    Alternate weapons fire. Normally bound to mouse button 2.
  • For much more information about Half-Life configuration syntax and console commands, visit the Command Center.

So, for example, if you open your config.cfg file you'll find the following line (unless it has been changed):

bind "MOUSE1" "+attack"

This is how mouse button 1 is bound to the "fire" action. The standard config file uses double-quotes around each argument.

Example: The Big Tweeze's Favorite Mouse Button Bindings

The Big Tweeze's Button Bindings
Button assignment on The Big Tweeze's mouse.

Most importantly, I want to be able to grab the crowbar quickly, and I always fumble for the "1" key, so I've assigned the left side button (MOUSE4) like this:

bind "MOUSE4" "use weapon_crowbar"

I tend to fumble the "q" key (usually bound to lastinv, toggle between last two weapons), so instead I like to use the center mouse button (MOUSE3) for this purpose. I bind it to the lastinv action like this:

bind "MOUSE3" "lastinv"

I also removed the standard binding for the q key so I don't hit it by mistake. My pal Sweaty binds MOUSE3 to +reload.

The mouse wheel can be used to scroll through your weapons inventory. These are now part of the standard configuration:

bind "MWHEELDOWN" "invnext"
bind "MWHEELUP" "invprev"

The remaining question is what to do with the right side mouse button, MOUSE5. I tried using it to select the satchel charge, but that has not worked very well for me. Sweaty has MOUSE5 bound to the machine gun and he's been whupping me lately, so that might be a good one to try. Currently I'm trying it with the shotgun:

bind "MOUSE5" "use weapon_shotgun"

All you have to do is edit config.cfg with your favorite text editor and add these lines. Put them next to the existing MOUSE lines. Never be afraid again to switch to "The Bar" in close combat!

Members: Login

Not yet registered?

Click here

Donations help support this site.
TweezerTip™:
Get the Mouse
A 5-button mouse with wheel can give you a real advantage in Half-Life.
Microsoft Intellimouse Optical Pictured above is the IntelliMouse Optical by Microsoft, the favored choice of . Optical mice track better, with no ball or rollers to gum up. The Intellimouse Optical retails for $55.

You may prefer the Intellimouse Explorer, which has a different button arrangement. It lists for $20 more, but actually cost only about $6 more when I checked PCMall.com.

When I checked at PCMall.com. their prices were about $48 for the Intellimouse Optical and $55 for the Intellimouse Explorer. You can also try buy.com (and here) but don't be confused by their description, which calls this a "2 button" mouse. It isn't.
Weapon Names
The use command requires the name of the item to use. There are various kinds of items, but weapons are the only sort we deal with in this article. Here are all the weapon item names:

weapon_357
weapon_9mmAR
weapon_9mmhandgun
weapon_crossbow
weapon_crowbar
weapon_egon
weapon_gauss
weapon_handgrenade
weapon_hornetgun
weapon_rpg
weapon_satchel
weapon_shotgun
weapon_snark
weapon_tripmine
TweezerTip™:
Paint Shop Pro
Jasc Paint Shop Pro 7

Jasc Paint Shop Pro 7 is the latest version of this hugely popular image editing utility. This is what uses and recommends for creating personal logos and editing crosshairs.

For more information see .
 
Updated Thursday July 04, 2002 06:31:28 PDT
Site email to theTweeze@chipchapin.com