System wide mouse gestures with dzMouseGestures

When Mozilla released their last big update, they deprecated quite a few APIs for plugins. One of these plugins was FireGestures which I used to get some of the mouse gestures of Opera in Firefox. There are a few new plugins that try to replace FireGestures but none of them really seemed to work quite the way I wanted them, so I thought “Hey, you are a programmer, just write it yourself. It can’t be that hard.”.

It turned out it isn’t that hard, really. So, here comes dzMouseGestures, a tool, that supports 3 different mouse gestures and converts them to keyboard input for Mozilla Firefox:

  • Down -> Right: Ctrl+w
  • Left -> Right: Alt+Left
  • Right -> Left: Alt+Right

It requires the user to hold down the right mouse button while making these gestures.

It took me a few hours to figure out how to install a system wide mouse hook and use that to interpret the mouse movements, convert them to gestures and send key sequences to Firefox. It works for me.

The source code and version 0.0.2 of the binaries (a dll with the hook and an executable that loads this dll and displays some debug information) is available on SourceForge.