X.Org/Mouse

The way input devices are configured in Xorg recently changed a lot. Xorg is pushing the generic input driver evdev (making the keyboard and mouse driver obsolete), which supports all keys and buttons of multimedia input devices, and the use of HAL to provide input hotplugging.

Xorg Setup
First add this line to your :

Also check with, that the USE flag is enabled. Then install X.Org:

or update your installed xorg server:

Now follow the X.Org guide to complete the setup and to start the X server.

Available Options
Today the input devices get configured by HAL. The use of the for input configuration is deprecated. To add an option, you have to create a .fdi file. Here an example how to enable the emulation of the third (middle) button for 2-button mice:

You can set all other options like this. Just add another line. For more informations about HAL and .fdi files, see the HAL article.

For more options and their meanings, see the installed man page:

using xinput
It may be, that the default configuration does not produce the desired results and you may have to manually remap the mouse buttons to the correct function. For this we need xinput:

Note: We've recorded already a lot of Individual Configurations about special xinput modifications. The xmodmap modifications can easily applied to xinput.

To apply xinput to your mouse (there may be more than one), we have to find out the right device name. Run shows all input devices. The quoted name the device name. Now you rearrange the buttons with:

Here an example:

You can test the results of your remapping by running and pressing the button in question while keeping the cursor inside the black box in the window. It will give you a lot of information you don't need, but it will tell you which button X thinks it is once it's remapped. By default, X does sees all buttons as a 1-to-1 physical mapping with what the mouse driver tells it. If your new config works well and you want to apply it automatically on each start, add a script in :

Afterwards make it executeable:

using fdi configuration file
Another possibility is to define button mapping in by adding the ButtonMapping option in the mouse section:

Uncontrollable mouse in SDL apps
It seems that with evdev, DGA gets broken in SDL: mouse jumps and moves down-right all the time. To fix this try starting your application with SDL_VIDEO_X11_DGAMOUSE=0 - if this doesn't work you have to add this to your :

Article retrieved from "http://www.gentoo-wiki.info/X11_Mouse/Xorg_7.3"