Normally, the mouse pointer buttons are mapped as follows:
Table 9-1 Default Mouse Button Mapping.
Button Number | Button on a 2-button mouse | Button on a 3-button Mouse |
---|
Button 1 | Left button | Left button |
Button 2 | Both buttons simultaneously | Middle button |
Button 3 | Right button | Right button |
Button 4 | | Left and middle buttons simultaneously |
Button 5 | | Middle and right buttons simultaneously
|
However, you can change these mappings. To generate buttons 4 and 5 on a three-button mouse, you must enable button chording as described later in this chapter.
Table 9-2 Alternative Mouse Button Mappings.
To press Button | Left Hand Mapping | OSF/Motif Mapping |
---|
| 2-button mouse | 3-button mouse | 2-button mouse | 3-button mouse |
---|
Button 1 | Right button | Right button | Left button | Left button |
Button 2 | Both buttons simultaneously | Middle button | Right button | Middle button |
Button 3 | Left button | Left button | Both buttons simultaneously | Right button |
Button 4 | | Middle and right buttons simultaneously | | Left and middle buttons simultaneously |
Button 5 | | Middle and left buttons simultaneously | | Right and middle buttons simultaneously |
The xmodmap utility can be used to change mouse button mappings. The syntax for changing mouse button mappings with xmodmap is:
xmodmap [-e -pp "[pointer = default pointer = number [number...]]"]
- -e
Specifies a remapping expression. Valid expressions are covered in "Customizing Keyboard Input" later in this chapter.
- default
Set mouse keys back to default bindings
- number
Specifies a list of button numbers to map the mouse keys to. The order of the numbers refers to the original button mapping.
- pp
Print the current pointer mapping.
For example, to reverse the positions of buttons 1 and 3 for left-handed mapping:
xmodmap -e "pointer = 3 2 1" 2-button mouse
xmodmap -e "pointer = 3 2 1 5 4" 3-button mouse
|
To establish OSF/Motif-standard button mapping:
xmodmap -e "pointer = 1 3 2" 2-button mouse
xmodmap -e "pointer = 1 3 2 4 5" 3-button mouse
|
xmodmap is discussed in more detail in “Modifying Modifier Key Bindings with `xmodmap'”.