I use Autohotkey for that, it is freeware. It is very easy to program, and its help file explains it very well, with many examples. See for example this piece of code:
^!+a::
#IfWinActive ahk_class MozillaUIWindowClass
Click 950, 43
SendInput {Tab}{Tab}{Tab}{Tab}{Tab}{Home}
#IfWinActive
return
If alt-control-A is pressed, Autohotkey checks whether Firefox (Mozilla) is the active window; if it is, a mouseclick is carried out at position 950, 43; then the keys Tab, Tab etc. are pressed. The last two lines tell AHK that this action is finished. You can just copy and paste this code into a text file, then save it as "whatever.ahk". If you have AHK installed, you can double click "whatever.ahk" to make the script active (or you can have Windows load it on start-up): if this script is active, every time you press control-alt-A, it gets triggered etc. This is just an example of the countless things AHK can do. There are many ready-made scripts available around the internet and on the AHK forum.