Getting the Logitech m610's email button to work with GMail

The Logitech m610 is a wireless mouse with a few nifty additions to the usual wireless laser mouse feature mix. Most notably:

The downsides covered in most reviews are obvious, that the mouse isn't rechargable (uses standard AAs) and that the email and IM buttons only work with Outlook/Outlook Express and Yahoo/Microsoft Messenger, respectively. A serious failing in the Logitech SetPoint software, in my humble opinion. The only thing I'd add to those is the lack of a small compartment for the USB transmitter, which is pretty tiny and could easily fit inside the mouse.

I'm not one to give up quite so easily on a cool feature like email notification, even though I never use Outlook or OE. The Instant Messaging I can live without, but I bought this mouse for $20 and the little blue light was a big selling point. So I set about figuring out a way to get it to work with Google Mail, my client of choice.

Setting it up requires a few steps:

Step 1 : Configure the mail button to open your client
Registry settings and javascript script
Using the great work done by Graham Wilmott I created this javascript file to launch gmail (only slight modifications to his original). Alternately you can use a very small file which contains simply the following:
var objShell = WScript.CreateObject("WScript.Shell");
This just launches the default browser to If you use the more complete javascript file, then clicking on mailto: links will open the gmail compose window, which is nice. Use the above two lines if you're having problems or use a client other than gmail. I use Firefox so it opens in a new tab, and if I'm already logged in, it just goes to my inbox. If you use hotmail, yahoo, or something else, change the second line above to your preferred site. It can even be a non-email site, if that tickles your fancy.
Step 2 : Light up that email button
Outlook Express Data Files
The way the mouse software knows there's new mail is by watching the Inbox.dbx file for the default Outlook Express Identity. This is determined by the regkey HKEY_CURRENT_USER\Identities\Default User ID. Outlook Express modifies the file Inbox.dbx when new mail comes in, so that's the key to manipulating the light. Mail checking with a Perl script
Disclaimer: All of the following assumes you'll never actually run outlook express again; if you do, then expect your inbox to be blown away repeatedly.
Use this perl script and run it as an NT service. It does the following: That's about it - now the mouse's button should light up, Outlook Express doesn't even need to be running.
Some things to note I haven't written a C program to automate the mail checking yet, and if anyone's up for collaborating on some open source freeware to do it, great. Until then, I'm living with a perl script running in the background. I'd love to write a little nullsoft installer that does all of the above, including setting up regkeys, finding the outlook profile and inbox files, and launching a background process for notification, but time isn't something I have a lot of these days. If someone does it, please let me know?

Questions, comments to s a i @ e n t r o p y f a r m . o r g

page version history
01/26/06 : v.001 : Initial rev. Used Google Talk registry key to determine inbox state: HKCU\Software\Google\Google Talk\Accounts\mailstate
01/27/06 : v.002 : Determined SetPoint knowledge of Outlook Express Identity: HKCU\Identities\Default User ID
01/27/06 : v.003 : Found Graham Wilmott's javascript script and regkeys to replace outlook express as the default Windows mail client.
01/27/06 : v.004 : Discovered Erik Kastner's perl gmail scraper which might obviate the need for google talk. one less program in my system tray.
07/09/08 : v.005 : Updated instructions and perl script to use GMail::Checker

h o m e       |        b l o g       |        s o f t w a r e       |        t h i n g s