Yes, thanks - should have thought of that before posting.
However, having done some research I now have a more particular problem. The key to programming mouse buttons seems to lie in a program called "imwheel", which I have installed. However try as I might I cannot figure out how its config file "imwheelrc" is meant to work. I did some Googling but many pages seem to repeat the same info from https://help.ubuntu.com/community/ManyButtonsMouseHowto
, but I can't work out what I want to do from this page.
It seems I start off by specifying a section in imwheelrc that relates to the application I want to change mouse behaviour for. This would be GQView, so I kick off the section with:
But now I am at a loss as to how to specify that clicking the middle wheel button should do the same thing as ALT-F4, i.e. exit the program. In fact, in none of the examples is the middle mouse button mentioned, nor the word I should use for it. Left, right, up, down all refer to other buttons, or presumably the up & down functions of the wheel.
Does anyone have specific knowledge of using imwheel in this way, please?