April 12, 2011

How to Create Perforce Key Bindings

Traceability

I hate mice. Not the cute varietals with names like Mickey or Fieval, but the kind that makes my wrist burn with pain due to repeated stress. As a result, I try to minimize my mousing and use the keyboard as much as I can. This was easier when I was a 9 year old kid in front of a PC running DOS 3.3 (the first OS I ever used!). These days, it’s virtually impossible to use a computer without a mouse - luckily for us, there are some tricks to limiting mouse use in our daily work routine.

In Eclipse, I like to assign keys to Perforce commands to avoid constant clicking on the Team context menus. For example, to create a key binding for checking out a file, I just (instructions are on Eclipse 3.6):

  1. Install P4Eclipse
  2. Click on Windows | Preferences
  3. Expand General | Keys
  4. In the filter field, enter “Perforce”
  5. Click on the the “Check Out” command
  6. In the Binding field, press CTRL+E (To match P4V shortcuts)
  7. Click the OK button
Keybinding Pref Page
Keybinding Pref Page

My wrist will now be happy to know that I can press CTRL+E to check out a file instead of context clicking on Team -> Check Out.

Team Context Menu
Team Context Menu