20 August 2008 - 11:25Gmail Keyboard Commands

Being able to read, write, organize, search mail in Gmail without ever having to touch the mouse is really convenient. I’ve even installed a Greasemonkey script, Modified Gmail Macros v. 2.0 [userscripts.org] that lets me label messages just by pressing “l” then typing part of the label.

Unfortunately, sometimes Gmail doesn’t know that you’re typing — keyboard commands all of a sudden stop working.

I’ve noticed this a lot recently when I use [alt]-[enter] to open a new tab from the location bar. This often happens when I’m reading a bugmail and want to see what a bug is, so I copy/paste the bug number and type “bug 395739” into the location bar and hit [alt]-[enter] so that the keyword search opens the page in a new tab. After switching back to the Gmail tab, I can no longer press “u” to return to the message list; instead, find-as-you-type finds a random link containing “u”.

Gmail Macros Bugzilla

Adding labels to bug messages just by typing

So to address this issue, I’ve written a simple Greasemonkey script that fixes the problem that I’ve been running into. It even lets you hit [tab] from the location bar (to the search bar) to the web page and have keyboard commands working in Gmail.

If you have Greasemonkey [addons.mozilla.org] already installed, all you have to do is click the following link to install the fix:
Gmail Fix Focus [ed.agadak.net]

For those curious, the reason why this focus problem occurs is that when Firefox opens a page in a new tab, it decides to move focus from the location bar into the page. However, Gmail is made of a bunch of IFrames, so focusing the outermost-top page doesn’t send the keyboard presses to the right place.

4 Comments | Tags: Add-on, Google, Mozilla


  1. I noticed this very same thing just today; thanks for the fix.

  2. […] work, unless you focus the page (via clicking on it, tabbing through it, etc.)  Edward Lee has put together a very useful Greasemonkey script, which is a definite must-have.  Go ahead and install it […]

  3. Also: if you have “Search for text when I start typing” it frequently prevents you from using keyboard shortcuts. Lame, but I prefer the search to the shortcuts, especially when I usually use a client anyway.

    Just something I’ve noticed.

  4. This problem has been annoying me for a long time.
    Thank you.

Subscribe without commenting

Add a Comment