Alright. I just bought a Logitech Mediaplay wireless USB optical mouse, which has like 432687543 buttons. (I love buttons.) But I only love them when they do something, so I'm figuring out how to make them all work. It has 7 regular mouse "buttons" as far as X is concerned, normal left and right, scroll press, scroll up and down, and thumb back and forward (used in browsers, etc.) It also has a tilt wheel, though, which would mean 9 buttons? I don't know. Then it also has multimedia buttons so you can use it like a remote control, listed below. These ones show up as keycodes (I think). I am on a Dell Inspiron 8600c laptop, and am using the touchpad/trackpoint and external mouse at the same time. ("And you expect to get all the buttons to work?! In Linux?? You're out of your mind!!") :-)
I have figured out to put some things in my XF86config file:
Code:
# Logitech Mediaplay wireless optical USB mouse:
Section "InputDevice"
Identifier "USB Mice"
Driver "mouse"
# Option "Protocol" "IMPS/2"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "6 7"
Option "ButtonNumber" "7"
Option "Buttons" "7"
EndSection
and
Code:
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Default Keyboard"
InputDevice "Default Mouse" "CorePointer"
InputDevice "USB Mice" "SendCoreEvents"
EndSection
As you can see, I tried the IMPS/2 first, but it doesn't seem to recognize all 7 buttons.
X recognizes scroll wheel movement as z-axis movement (normal pointer movement is x and y) and this line configures it to remap z-axis as buttons 6 and 7. Most apps recognize 4 and 5 as scrolling, but if we say remap to 4 and 5, we will not be able to use the back and forward buttons. So we map them to 6 and 7 first, and then switch 4/5 and 6/7 using xmodmap:
Code:
xmodmap -e "pointer = 1 2 3 6 7 4 5"
(I am getting this from here:
http://www.glaurung.demon.co.uk/info...500.howto.html)
Now when I scroll, applications get buttons 4 and 5, and when I click forward and back, the applications get 6 and 7 (which Firefox recognizes as forward and back! hooray!) Here's where my major question comes in:
The first time I did this, it seemed to work. I didn't realize the 6 and 7 functioned as forward and back yet, so I don't know for certain that they worked, but I assume so. The second time I did this (after changing some options and restarting X), it didn't work, but then I noticed that my scrolling (right hand strip) and back/forward (bottom strip) on my touchpad were reversed! Sure enough, changing the xmodmap back changed them back. So xmodmap was only affecting the touchpad now and not the external mouse. I imagine it was only affecting the external mouse the first time I did it, though I don't know that for certain.
Major question: How do I use xmodmap to affect only one of the pointers?
It seems that xmodmap only affects the CorePointer, and I cannot get the USB mouse to work configured as CorePointer; only as SendCoreEvents. Is there a way to use another program like imwheel to remap the buttons on only one of the pointers?
After I figure this out, I will try to configure the multimedia buttons for my mouse and for my laptop keyboard. I have already figured out the keycodes for the Dell Inspiron 8600c laptop through xev (I am sure other people will be looking for these):
volume down: 174
volume up: 176
volume mute: 160
play/pause: 162
stop: 164
previous: 144
next: 153
and the keycodes for the multimedia buttons on the mouse, which don't show up in xev for some reason, but do show up during boot, when i press them all and it gets annoyed and prints the message "keyboard.c: can't emulate rawmode for keycode xxx".
Media: 277
+ (vol up): 280
- (vol dn): 281
>> (next): 282
<< (prev): 283
play/pause: 284
Secondary question (that I can probably figure out on my own but I might as well ask): Is there an easy way to map these to common functions in different apps? Like does imwheel have a generic "play" mapping that I can just supply the right keycode number to, or do I have to configure each app myself?