Check out AutoHotkey_L free scripting language:
To make a program that sits in the tray and waits for you to press a hotkey is pretty easy. It has commands to simulate mouse clicks and send keys. You can tell which window to act on using the window class. I believe FF 4+ is MozillaWindowClass.
If you get stuck there's forums to get help. Basically if FF is the active window you would hit the hotkey you made. To make a control-winkey-d hotkey, that only works when FF 4+ is the active window is as simple as:
#IfWinActive ahk_class MozillaWindowClass
; Send some keys or click mouse etc..