First things first, install Optimoz gesture control - a Mozilla enhancement that allows you to control basic browser functions using mouse gestures. Optimoz can be found at:
Once you have installed Optimoz, gotten it configured to your liking, and passed through the stage where you're randomly waving your mouse around and giggling as your windows magically appear and disappear, you're ready to apply this small hack.
The first file you need to modify is called gestimp.js. This will be in a different place depending on your OS, and where you decided to install Mozilla.
Assuming you installed Mozilla in the default install location, you'll find the file in these directories:
Windows: C:\program files\mozilla.org\mozilla\chrome\mozgest\content\
Mac OS: *mozilla-install-dir*/chrome/mozgest/content/ (where *mozilla-install-dir* is wherever you installed Mozilla to)
Open up gestimp.js in a simple text editor (Notepad, for instance) and scroll down until you find // *** misc ***. Now copy the line of code below and paste it in below the 'misc' line.
addGesture("RULDR", bundle.getString("g.openE2SearchBox"), "openE2SearchBox();");
Scroll down to the bottom of the file and insert the following:
void(q=prompt('Enter text to search:',''));
We're not finished yet. Go up one directory in the tree (to the /mozgest dir) and look for the locale dir. Inside here should be another dir called en-US, and inside that one a second mozgest dir. Inside this is the second file we need to modify - mozgest.properties. Open this in a text editor, and scroll down until you find a big block of text with # gesture descriptions on top. Copy and paste the line below into the file, below the last entry in the gesture descriptions list.
g.openE2SearchBox=Search for text on E2
Save both files, then close and reopen Mozilla. Under linux you may have to re-register the files to get it to work. (please do not ask me what this means. I don't run Linux. I've only used Mozilla for one day. Go prod fuzzie instead.)
Okay, you're finished the modifications; now here's the fun part. Hold down whatever button you use for gesture control (the default is left mouse button, although I find the right more convenient) and move your mouse Right, Up, Left, Down and Right again, in a sort of square 'e' shape. A little box should pop up for you to type your search text into. Type in some text, hit OK, be happy.
If it doesn't, repeat the gesture, but don't let go of the button at the end. Look at the status bar - it should say "Mouse Gesture - R,U,L,D,R". If it says anything different, you're doing something wrong. If the status bar reports that you're moving the mouse correctly, but nothing comes up, or "Unknown Gesture" appears when you release the mouse button, check you've copy-and-pasted the code into the right files, and that it's exactly as it appears on this page.
If you want to know more about customising Optimoz, this page has some info on the format used in the config files:
Do note that this only gives one of the mods you need to make (the gestimp.js one) - remember to modify mozgest.properties as well.