Alexios' Home Page

Control Logitech USB Mice 

HomeProgramming ► LMCtl ►

Recently, I was presented with a lovely Logitech optical mouse (an MX500). It has a wheel, no fewer than eight buttons, and an excellent 800 cpi resolution. Unfortunately, Linux would see it as a 400 cpi device, and two of the buttons would echo the wheel. A bit of quick research on the web uncovered the sage advice ‘you can't do anything about the extra buttons, live with it’. It also uncovered a list of vendor-specific USB control commands for Logitech mice (proving yet again that the majority of Linux users are no longer producers but ― at best ― consumers).

Enter lmctl, a quick hack I wrote to control USB Logitech mice. It will obviously only work in the mouse's USB personality (not when it's connected to the PS/2 port with its adaptor).

lmctl supports various vendor-specific commands, a good proportion of which isn't supported by my own mouse (an example is wireless status reporting). As such, it's provided as is, and it may not work on your mouse at all.

The tool is available as source, Debian and RPM packages. It's provided under the terms of the GNU General Public License, version 2. There is a Freshmeat entry available.

Manual Page 

LMCTL

NAME
SYNOPSIS
DESCRIPTION
EXIT STATUS
OPTIONS
BUGS
AUTHOR
REPORTING BUGS
COPYRIGHT
SEE ALSO

NAME

lmctl − Configure Logitech Mice

SYNOPSIS

lmctl [OPTIONS]

DESCRIPTION

lmctl can configure vendor-specific options on Logitech USB mice (or dual-personality mice plugged into the USB port). A number of recent devices are supported. The program is mostly useful in setting the resolution to 800 cpi on mice that boot at 400 cpi (such as the author’s MX-500), and disabling SmartScroll or Cruise Control for those who would rather use the two extra buttons as ordinary mouse buttons.

Hint 1: use a Linux kernel with Event Interface support (the evdev module) if you want full access to the numerous buttons on these mice.

Hint 2: on Linux, the usbmouse driver ignores the extra buttons altogether. Don’t let it handle your Logitech mice ― use the generic hid driver for USB HID devices instead.

EXIT STATUS

An exit status of zero indicates successful termination. A non-zero exit status denotes abnormal termination due to an error.

OPTIONS

lmctl accepts a number of arguments. The following arguments control which device is accessed or modified:

-b, --bus=USB-BUS-NUMBER

Only apply the command to the specified bus, specified in full (e.g. use -b 001 for bus 1). This is in the same format as reported by lmctl -s (the first column, on the left hand side of the period) or lsusb(1) (next to ‘Bus’).

-d, --dev=USB-DEVICE-NUMBER

Only apply the command to the specified bus, specified in full (e.g. use -d 01b for device 27). This is in the same format as reported by lmctl -s (the first column, on the right hand side of the period) or lsusb(1) (next to ‘Device’).

-p, --pid=USB-PRODUCT-ID

Only apply the command to the specified USB product ID, specified in hexadecimal and in full (e.g. use -p c025 for an MX-500 optical mouse). Again, you can use lmctl -s or lsusb(1) to get a listing of product IDs (the right hand side of tuples like 046d:xxxx).

The following generic actions can be performed:

-i, --inquire

Obtain and display the status of all supported capabilities for all matching devices.

-s, --scan

Scan the USB bus and report all matching, supported Logitech mice.

The following commands configure wireless receivers and mice with the CSR command set (use lmctl -s to see if yours supports it):

-1, --ch1

Set matching devices to channel 1. Please be aware that not all CSR-supporting devices are dual channel.

-2, --ch2

Set matching devices to channel 2.

-c, --clear

Make all matching receivers forget about the mouse connected to it, just as if the Connect button on the receiver had been pressed for three seconds.

-l, --lock

Stop the 30 second search for a wireless mouse on all matching receivers. This search is initiated using the -u option, or by pressing the Connect button on the receiver.

-u, --unlock

Unlock all matching receivers and initiate a search for any wireless mouse in range. This is the same as pressing the Connect button on the receiver.

The following settings control mouse resolution, for mice with both 400 and 800 cpi support, and the RES capability.

-4, --400

Sets matching devices to a resolution of 400 cpi.

-8, --800

Sets matching devices to a resolution of 800 cpi. Very useful on certain Logitech mice (the MX500 is one of them) that boot in 400 cpi.

The following settings control SmartScroll/Cruise Control, for mice that support it (i.e. include the SMS capability).

--no-sms

Disable SmartScroll/Cruise Control an all matching mice. ‘Up’ and ‘down’ buttons do not also issue wheel events. Useful if you want to use the additional buttons for something else.

--sms

Enable SmartScroll/Cruise Control an all matching mice. ‘Up’ and ‘down’ buttons will now also issue wheel events (but will also issue their native button events, which user applications are expected to ignore). This is how most mice boot.

Other, miscellaneous options:

-?, --help

List all available options and their meanings.

--usage

Display brief usage information.

-V, --version

Show the program’s version, credits and licensing.

BUGS

I only have an MX500, which lacks the CSR set. As such, this code is untested.

lmctl is an early version of a quick hack ― there are almost certainly numerous other bugs.

AUTHOR

Written by Alexios Chouchoulas.

REPORTING BUGS

Report bugs to Alexios Chouchoulas <alexios@vennea.demon.co.uk>.

COPYRIGHT

Copyright © 2004 Alexios Chouchoulas <alexios@vennea.demon.co.uk>.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO

lsusb(1).

s