MozillaZine

Linux and the mouse

From MozillaZine Knowledge Base

This article applies to Firefox.

Summary

This knowledge base article contains the core KB HOWTO enable the Horizontal Scroll in Firefox under most Linux distributions including Mandriva Linux 2006 PowerPack+. It is the successor to the Mozillazine topic The Linux, the Logitech and the Firefox. It is currently intended to be a primer on discovering how to enable all the features of your mouse if it not supported out of the box by your Linux distribution. As software and hardware continually evolves, this article will attempt to cover only the basics and also include any contributed mouse identification parameters of known mice.

The documentation found from an internet search was somewhat incomplete and spread out and sometimes even non-existent. This article will continue to focus on a particular Linux distribution and a particular mouse, but it also includes sections for other mice, other distributions and of course a notation section on each step of the HOWTO. This is necessary to prevent the abstract nature from becoming completely random and spread out like those found on other sites.

Some things may be different for you...

  • Your distribution of Linux
  • Your mouse revision and model
  • Your version of the Mozilla browser of your choice.

There are several variants of this configuration, but this setup seems to be the most robust and the most portable and very usable in Firefox under most Linux distributions, including Mandriva.

PLEASE MAKE A BACKUP BEFORE YOU MODIFY SYSTEM FILES!

top

Contents


Definitions

X axis is typically referred to as "moving your mouse left or right".
Y axis is typically referred to as "moving your mouse up or down".
Z axis is typically referred to as "using the scroll wheel" to move up and down a web page quickly.
W axis is typically referred to as "using the horizontal (tilt) scroll wheel" to move left and right on a web page quickly.

top

Installation

Pick a mouse

As there are several hundred mice out there and several Linux distributions available, the installation will continue to focus primarily on the Logitech MX-1000 under Mandriva.

The way it appears the kernel handles events from this mouse type is X, Y, Z and W axes and 10 real buttons (the two additional buttons are on the W axis ) XWindows via whatever driver is chosen and configured will map those existing key events (buttons) into the Z and W axes...sometimes correctly, sometimes INCORRECTLY even on newer versions of Linux.

top

System configuration

  • Plug in your mouse and reboot the computer just to make sure your Linux distribution has done all of it's automatic configuration, which is WHAT YOU DO NOT WANT later.
  • Find out the reported name of your USB Logitech MX-1000 by running #less /proc/bus/usb/devices

For the test mouse it returned a lot of entries including this section:

 T:  Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
 D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=046d ProdID=c50e Rev=25.10
 S:  Manufacturer=Logitech
 S:  Product=USB RECEIVER
 C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 70mA
 I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

NOTE: The bold text is what you are after on your system. You will need this EXACT TEXT to put into the next step. Some reference sites used the Logitech and USB Receiver entries instead, but the mouse tested here returned upper case characters... for this reason pay attention to the case of every alphanumeric character.
  • Make a udev rule text file called 10-local.rules at /etc/udev/rules.d

 # udev rule for Logitech MX-1000 Cordless Laser Mouse
 KERNEL=="event*", \
 SYSFS{idVendor}=="046d", \
 SYSFS{idProduct}=="c50e", \
 SYMLINK="input/mx1000", \
 GROUP="root",OWNER="root",MODE="0664"

Confirm permissions are set using #chmod 664 /etc/udev/rules.d/10-local.rules

(more information can be found on udev rules by using $man udev and of course an internet search)

REBOOT

top

XWindows configuration

  • Find and Backup/Modify your input device called Mouse1 in the xorg.conf located at /etc/X11

 Section "InputDevice"
   Identifier "Mouse1"
   Driver "evdev"
   Option "Device" "/dev/input/mx1000"
 EndSection

NOTE: If you plug in another mouse later on, Mandriva's automatic configuration is going to add another Mouse1 entry into the file and mess up the buttons and potentially lose mouse functionality altogether.
NOTE:To confirm the presence of this driver, check to see if /usr/X11R6/lib/modules/input/evdev_drv.so exists. Mandriva did not initially include documentation on the evdev driver, so a visit to another Linux distribution man page may be helpful. Web searches for documentation of this driver seem to be limited as of this writing.

top

KDE configuration

This configuration may or may not be necessary depending on if the newer version of evdev is present and configured properly. It is included for backwards compatibility as well as forced forward compatibility.

  • Create a text file called .Xmodmap at the /etc/X11/xinit containing:

 ! Reorder middle click, right click, Z and W axes
 pointer = 1 3 2 4 5 6 7 8 9 10 11 12

Confirm permissions are set using #chmod 664 /etc/X11/xinit/.Xmodmap

NOTE: The mouse and Mandriva currently still requires reordering of the buttons to make everything work in KDE and KDM and Firefox. Running $/usr/X11R6/bin/xev in XWindows will identify which button values may need to be reordered. Events (buttons) 2 and 3 were mapped backwards; Events 4 and 5 should be the Z axis;. Events 6 and 7 should be the W axis, which is why the above numeric sequence is necessary. Firefox currently only recognizes events 1 through 7 for mice. Once you think you have reordered them correctly, check xev again. Other mice tested reorders 6 & 7 when 3 & 4 are reordered, so an additional reorder may be necessary. Double check your results with xev.
  • Create a shell script text file called Xmodmap at ~/.kde/Autostart containing:

 #!/bin/sh
 xmodmap /etc/X11/xinit/.Xmodmap

Confirm permissions are set using $chmod 774 ~/.kde/Autostart/Xmodmap

NOTE: Mandriva and KDE currently doesn't automatically call the binary executable xmodmap at the needed time that evdev is finished loading, so it is necessary to call it using the configuration file made in the previous step.

RESTART X

top

GNOME configuration

This configuration may or may not be necessary depending on if the newer version of evdev is present and configured properly. It is included for backwards compatibility as well as forced forward compatibility.

  • Create a text file called .Xmodmap at ~ containing:

 ! Reorder middle click, right click, Z and W axes
 pointer = 1 3 2 4 5 6 7 8 9 10 11 12

Confirm permissions are set using $chmod 664 ~/.Xmodmap

NOTE: Mandriva and GNOME needs access to this file to set the button mappings. If you wish to use a symbolic link to the global .Xmodmap made for KDE/KDM, you can, instead of creating a new text file (e.g. $ln --symbolic /etc/X11/xinit/.Xmodmap ~/.Xmodmap ... Symbolic links don't have permissions, but their targets do.).

RESTART X

top

Browser configuration

  • Set the minimum necessary suggested preferences in the about:config

 mousewheel.horizscroll.withnokey.action       user set    integer     0
 mousewheel.horizscroll.withnokey.numlines     default     integer     -1
 mousewheel.horizscroll.withnokey.sysnumlines  user set    boolean     true

top

Packages

Mandriva Linux

(Mandriva/Mandrake is the predominantly discussed platform in this article.)

  • Mandriva Linux 2006 PowerPack+
(Mandriva Linux Control Center 2006.0 (Official) Software Packages Update are current as of this writing)
Kernel 2.6.12-12mdk (Default installed kernel)
udev (Kernel module installed by default)
evdev (Xorg server module installed by default)
Xorg 6.9.0-5.7.20060mdk
xev (X11R6-contrib-6.9.0-5.7.20060mdk.rpm)
KDE 3.4.2-55.5.20060mdk
  • Mandriva Linux 2007.0 PowerPack+
  • Mandriva Linux 2007.1 PowerPack+
  • Mandriva Linux 2008.0 PowerPack+
  • Mandriva Linux 2008.1 PowerPack+
NOTE: Some users have reported that middle clicks from Logitech MX-1000 are not being sent to XWindows.

top

K/Ubuntu Linux

Versions, source packages for evdev/udev/xev wanted

top

Debian Linux

Versions, source packages for evdev/udev/xev wanted

top

Other mice

Logitech

Logitech MX-1000 Laser Mouse

  • RF USB Receiver plugged into an available USB Port (M/N C-BN34)
  • M-RAG97 Laser Mouse (MX1000 P/N 852152-0100)
This mouse is commonly referred to as a 12 button mouse and additional documentation has also stated it as having 32 buttons. (X, Y, Z and W present)

 T:  Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
 D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=046d ProdID=c50e Rev=25.10
 S:  Manufacturer=Logitech
 S:  Product=USB RECEIVER
 C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 70mA
 I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

top

Logitech V200 Cordless Notebook Mouse

  • RF USB Receiver plugged into an available USB Port (M/N C-UM34)
  • M-RBK93B Cordless Laser Mouse (P/N 831491-0000)
This mouse is commonly referred to as a 7 button mouse. (X, Y, Z and W present)

 T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
 D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=046d ProdID=c510 Rev=34.10
 S:  Manufacturer=Logitech
 S:  Product=USB Receiver
 C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 50mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

top

Logitech MX400 Performance Laser Mouse

  • M-BZ105A Laser Mouse plugged into an available USB Port (P/N 831760-0000)
This mouse is commonly referred to as a 9 button mouse. (X, Y, Z and W present)

 T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  6 Spd=1.5 MxCh= 0
 D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=046d ProdID=c043 Rev=27.20
 S:  Manufacturer=Logitech
 S:  Product=USB-PS/2 Optical Mouse
 C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 98mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   5 Ivl=10ms

top

Logitech Cordless Desktop MX 5000 Laser

  • BlueTooth 2.0 EDR USB Receiver plugged into an available USB Port (M/N C-UV35)
  • Y-RAH72 Cordless Keyboard (P/N 867615-0403)
  • M-RBA97 Cordless Laser Mouse (P/N 852384-1000)
The mouse included in this keyboard/mouse combo is commonly referred to as a 12 button mouse. (X, Y, Z and W present)

Receiver

 T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 3
 D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=046d ProdID=0b02 Rev=40.02
 S:  Manufacturer=Logitech
 S:  Product=Logitech BT Mini-Receiver
 C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
 E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=255ms

Keyboard

 T:  Bus=01 Lev=02 Prnt=03 Port=01 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
 D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=046d ProdID=c70e Rev=40.02
 S:  Manufacturer=Logitech
 S:  Product=Logitech BT Mini-Receiver
 S:  SerialNumber=000761474EA8
 C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 98mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

Mouse

 T:  Bus=01 Lev=02 Prnt=03 Port=02 Cnt=02 Dev#=  5 Spd=12  MxCh= 0
 D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=046d ProdID=c70a Rev=40.02
 S:  Manufacturer=Logitech
 S:  Product=Logitech BT Mini-Receiver
 S:  SerialNumber=000761474EA8
 C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 98mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=5ms

top

Logitech G7 Laser Cordless Mouse

  • RF USB Receiver plugged into an available USB Port (M/N C-UX34)
  • M-RBH113 Cordless Laser Mouse (P/N 831410-0000)
The mouse is commonly referred to as a 10 button mouse. (X, Y, Z and W present)

 T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=12  MxCh= 0
 D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=046d ProdID=c51a Rev=41.01
 S:  Manufacturer=Logitech
 S:  Product=USB Receiver
 C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr= 98mA
 I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=1ms
 I:  If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
 E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=1ms

top

Microsoft

Mice wanted

top

Inland

Mice wanted

top

Kensington

Mice wanted

top

Notes

  • If you are running the SmoothWheel add-on, you may have to disable it. The last version tested of SmoothWheel was designed to replace the DOMMouseScroll Listener and is forced to treat ALL scroll events as a vertical (Z axis) scroll. The authors last known post for this extension is here.
  • Apparently the original tested browser did not fully implemented the DOM Level 2 specification for the DOMMouseScroll event. When an event is reviewed, the .button property always returns 0 (meaning Firefox button 0 (or left click)) which is not the desired implementation.
  • If it still isn't working, make sure some other extension is not interfering. Good luck! :)

top

External links

Additional information can be found by searching on the web for "gentoo wiki HowTo for mouse nav buttons" or go to it directly at HOWTO Advanced Mouse. Both methods may provide helpful information in your efforts to incorporate your mouse into your Linux distribution XWindows, but still seems limited on terminal/console incorporation.

top