I'm not sure if this is an xorg-server, evdev or xmodmap bug. I have Logitech MX510, with one wheel, two thumb buttons and three extra buttons. I want to map the event 2 (e.g. paste) from one of the extra buttons, since pressing the wheel is inconvinient. With identity mapping, the extra button sends event 11, and the wheel sends event 2. This is what I had working before: xmodmap -e 'pointer = 1 11 3 4 5 9 8 6 7 10 2 12' which means that the extra button sent event 2, and wheel press sent event 11. After updating xorg-server and evdev, the extra button now sends event 11 and wheel press sends event 2. So I try: xmodmap -e 'pointer = 1 2 3 4 5 9 8 6 7 10 11 12' No change! Still events 2 and 11 are the wrong way around. Then I try something funny: xmodmap -e 'pointer = 2 11 3 4 5 9 8 6 7 10 1 12' Now wheel press sends event 1, the extra button sends event 2, and the left mouse button sends event 11. Hmm, it is almost as if the mapping is applied twice. That makes configuring the buttons a tiny bit more... interesting. xf86-input-evdev is from git master as of Feb 10, 2009. xorg-server is from git master as of Feb 11, 2009. xmodmap is version 1.0.3. All built and installed in Gentoo using ebuilds. HAL is used to configure input devices, xorg.conf has nothing about input. I have no personal settings in HAL for the mouse.
git master has double button mapping. One applies to the virtual core pointer (i.e. the cursor) and one applies to specific devices. The button mappings are chained, so you can have the mapping on a device and have a different mapping on the VCP and the final is the combination of both mappings. I think that's what's hitting you, though I got a bit confused with the definitions of "wrong way round" in your report. try xinput --set-button-map "device name" 1 11 3 4 5 etc. (device name as listed by "xinput --list --short"). Does that work?
"Wrong way around" just means that I want the buttons 2 and 11 swapped, when they are not. Um, this is what happens, and it doesn't look right to me. First I have my old settings in my Xorg session's Xmodmap: pointer = 1 11 3 4 5 9 8 6 7 10 2 12 Then I run these commands: $ xinput --list --short "Virtual core pointer" id=0 [XPointer] "Virtual core keyboard" id=1 [XKeyboard] "AT Translated Set 2 keyboard" id=2 [XExtensionKeyboard] "Logitech USB-PS/2 Optical Mouse" id=3 [XExtensionPointer] $ xinput get-button-map "Virtual core pointer" 1 11 3 4 5 9 8 6 7 10 2 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 $ xinput get-button-map "Logitech USB-PS/2 Optical Mouse" 1 11 3 4 5 9 8 6 7 10 2 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 $ xinput set-button-map "Virtual core pointer" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 $ xinput get-button-map "Logitech USB-PS/2 Optical Mouse" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 $ xinput get-button-map "Virtual core pointer" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Setting the button map seems to set both maps at the same time. Should I update xorg-server or xf86-input-evdev from git/master just to be sure?
Created attachment 23143 [details] [review] 0001-dix-don-t-apply-button-mappings-to-SDs-or-the-devi.patch Yeah, you're right - this is wrong. This behaviour got changed in bc909f71367a02297e725bb5769c2bcadab22395, and IMO I don't think it's the right thing to do, we should only change the device we're interested in. Please try this (untested) patch on your xserver, it should revert to the old behaviour.
(In reply to comment #3) > Created an attachment (id=23143) [details] > 0001-dix-don-t-apply-button-mappings-to-SDs-or-the-devi.patch That patch indeed fixes it. Now everything works as I would expect: xmodmap changes the virtual core pointer button mapping, and I can use xinput to change the mapping on the specific device. As a bonus, now I know how I can change the mapping on *this* mouse instead of all mice :-) But one question here remains: is it possible to configure this automatically, if I plug this mouse in in the middle of my X session? I could put the button mapping in HAL config, so it would (I guess) be applied on device discovery, but this is a global setting, not per user. Right? It is my personal preference on this particular mouse to swap those buttons. Can that configuration be automated? (Just thinking out loud here.) Thanks. When I see this patch hit xorg-server git, I'll retest and mark as fixed.
Patch pushed as a50c40be1f28467bcef7dc71fab54ebdddacffdf.
> --- Comment #4 from Pekka Paalanen <pq@iki.fi> 2009-02-21 04:36:47 PST --- > But one question here remains: is it possible to configure this > automatically, if I plug this mouse in in the middle of my X session? > I could put the button mapping in HAL config, so it would (I guess) be applied > on device discovery, but this is a global setting, not per user. Right? > It is my personal preference on this particular mouse to swap those buttons. > Can that configuration be automated? (Just thinking out loud here.) I guess the desktop environment could provide an ui for this, listen to notifications for when new devices appear, and apply the user's settings.
Re-tested on xorg-server master branch, is fixed. Closing.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.