XF86Config Options

Mouse Support in XFree86 : XF86Config Options
Previous: Configuring Your Mouse
Next: Mouse Gallery

## 5. XF86Config Options

The old `Pointer` section has been replaced by a more general `InputDevice` section. The following is a minimal example of an `InputDevice` section for a mouse:

    Section "InputDevice"
    	Identifier	"Mouse 1"
    	Driver		"mouse"
    	Option		"Device"	"/dev/mouse"
    	Option		"Protocol"	"Auto"
    EndSection

The `mouse` driver supports the following config file options:

### 5.1. Buttons

This option tells the X server the number of buttons on the mouse. Currently there is no reliable way to automatically detect the correct number. This option is the only means for the X server to obtain it. The default value is three.

Note that if you intend to assign Z axis movement to button events using the `ZAxisMapping` option below, you need to take account of those buttons into `N` too.

    	Option	"Buttons"	"N"

### 5.2. ZAxisMappping

This option maps the Z axis (wheel) motion to buttons or to another axis.

    	Option	"ZAxisMapping"	"X"
    	Option	"ZAxisMapping"	"Y"
    	Option	"ZAxisMapping"	"N1 N2"
    	Option	"ZAxisMapping"	"N1 N2 N3 N4"

The first example will map the Z axis motion to the X axis motion. Whenever the user moves the wheel/roller, its movement is reported as the X axis motion. When the wheel/roller stays still, the real X axis motion is reported as is. The third example will map negative Z axis motion to the button `N1` and positive Z axis motion to the button `N2`. If this option is used and the buttons `N1` or `N2` actually exists in the mouse, their actions won't be detected by the X server.

The last example is useful for the mouse with two wheels of which the second wheel is used to generate horizontal scroll action, and the mouse which has a knob or a stick which can detect the horizontal force applied by the user. The motion of the second wheel will be mapped to the buttons `N3`, for the negative direction, and `N4`, for the positive direction. If the buttons `N3` and `N4` actually exist in this mouse, their actions won't be detected by the X server.

NOTE #1: horizontal movement may not always be detected by the current version of the XFree86 X servers, because there appears to be no accepted standard as to how the horizontal direction is encoded in mouse data.

NOTE #2: Some mice think left is the negative horizontal direction, others may think otherwise. Moreover, there are some mice whose two wheels are both mounted vertically, and the direction of the second vertical wheel does not match the first one's.

Currently this option can not be set in the `XF86Setup` program. You need to edit the `XF86Config` file by hand to add this option.

### 5.3. Resolution

The following option will set the mouse device resolution to `N` counts per inch, if possible:

    	Option	"Resolution"	"N"

Not all mice and OSs can support this option. This option can be set in the `XF86Setup` program.

### 5.4. Drag Lock Buttons

Some people find it difficult or inconvenient to hold a trackball button down, while at the same time moving the ball. Drag lock buttons simulate the holding down of another button. When a drag lock button is first pressed, its target buttons is "locked" down until the second time the lock button is released, or until the button itself is pressed and released. This allows the starting of a drag, the movement of the trackball, and the ending of the drag to be separate operations.

    	Option	"DragLockButtons"	"W X Y Z"

This option consists of pairs of buttons. Each lock button number is followed by the number of the button that it locks. In the above, button number "W" is a drag lock button for button "X" and button number "Y" is a drag lock button for button "Z".

It may not be desirable to use multiple buttons as drag locks. Instead, a "master drag lock button" may be defined. A master drag lock button acts as a "META" key. After a master lock button is released, the next button pressed is "locked" and not released until the second time the real button is released.

    	Option	"DragLockButtons"	"M"

Since button "M" is unpaired it is a master drag lock button.

Mouse Support in XFree86 : XF86Config Options
Previous: Configuring Your Mouse
Next: Mouse Gallery