I'm trying to find out where the default mouse actions are defined. By that I mean what is it that says that when (for example) I double click the left button the word under the mouse pointer is selected.
I know that the mapping of button physical numbers to logical numbers is done deep down in X by the function XSetPointerMapping and can be retrieved with XGetPointerMapping but this just sets up the mapping from the physical buttons such that, if one wants, one can make physical button 3 the 'Left' button and physical button 1 the 'Right' button (thus making the mouse 'left handed').
However the above mapping doesn't affect what actions occur when the (logical) buttons are clicked. So Left (logical 1) button always grabs things or selects text, Right (logical 3) tends to open menus and such.
Is it really down to every individual application to map the button events to actions or is there a common library (gtk maybe) which defines default actions for button events? If it's gtk what/where should I look to find the relevant code?
What I'm after doing is to change the mapping so that I can use a different button (button 9 in my case) to select text with a single click rather than a double-click of button 1. The normally recommended way of doing this (getting button 9 to emulate two clicks of button 1) has stopped working for me since an upgrade from ubuntu 9.10 to 10.04 and anyway it strikes me as a clumsy way of doing things.
There should surely be a mapping somewhere that links all the possible types of button click to actions:-
click left - select click middle - paste text click right - .... CTRL + click left - soemthing else etc.
... or, as I said, is it really down to each individual program?