Gentoo Archives: gentoo-desktop

From: Mickael Chazaux <mickael.chazaux@×××××.com>
To: gentoo-desktop@l.g.o
Subject: Re: [gentoo-desktop] Re: How to set per-device mouse sensitivity : Revisited !
Date: Thu, 22 Apr 2010 11:38:37
Message-Id: p2pbc36f8ed1004220437qa6ccc34exce83d6ee2c11cf21@mail.gmail.com
In Reply to: [gentoo-desktop] Re: How to set per-device mouse sensitivity : Revisited ! by Duncan <1i5t5.duncan@cox.net>
1 Hi,
2
3 2010/4/21 Duncan <1i5t5.duncan@×××.net>:
4 > Mickael Chazaux posted on Wed, 21 Apr 2010 20:36:32 +0200 as excerpted:
5 >
6 >> Hi,
7 >>
8 >> Again, I hit in the whizzingly fast mouse problem with Xorg. With my
9 >> previous release of Xorg (1.7.6) I solved this using a hal FDI file.
10 >> Here is the link fore reference :
11 >>
12 >> http://www.gossamer-threads.com/lists/gentoo/desktop/207830
13 >>
14 >> The solution was to merge this XML fragment [snip]
15 >
16 >> Today I tried Xorg 1.8.0, and I added this content to
17 >> /etc/X11/xorg.conf.d/10-evdev.conf :
18 >>
19 >> Section "InputClass"
20 >>         Identifier "My mouse"
21 >>         MatchProduct "Bluetooth Laser Travel Mouse"
22 >>         Option "AccelerationProfile" "-1"
23 >>         Option "ConstantDeceleration" "10"
24 >> EndSection
25 >>
26 >> In Xorg log (Xorg -retro -verbose 10 2>log) I see :
27 >>
28 >> (II) config/udev: Adding input device Bluetooth Laser Travel Mouse
29 >> (/dev/input/event12)
30 >> (**) Bluetooth Laser Travel Mouse: Applying InputClass "My mouse"
31 >>                  <<<<<<<<<<<
32 >> (**) Bluetooth Laser Travel Mouse: Applying InputClass "evdev pointer
33 >> catchall"
34 >> (**) Bluetooth Laser Travel Mouse: always reports core events
35 >> (**) Bluetooth Laser Travel Mouse: Device: "/dev/input/event12"
36 >> (II) Bluetooth Laser Travel Mouse: Found 12 mouse buttons
37 >> (II) Bluetooth Laser Travel Mouse: Found scroll wheel(s)
38 >> (II) Bluetooth Laser Travel Mouse: Found relative axes
39 >> (II) Bluetooth Laser Travel Mouse: Found x and y relative axes
40 >> (II) Bluetooth Laser Travel Mouse: Configuring as mouse
41 >> (**) Bluetooth Laser Travel Mouse: YAxisMapping: buttons 4 and 5
42 >> (**) Bluetooth Laser Travel Mouse: EmulateWheelButton: 4,
43 >> EmulateWheelInertia: 10, EmulateWheelTimeout: 200
44 >> (II) XINPUT: Adding extended input device "Bluetooth Laser Travel
45 >> Mouse" (type: MOUSE)
46 >> (II) Bluetooth Laser Travel Mouse: initialized for relative axes.
47 >> (II) config/udev: Adding input device Bluetooth Laser Travel Mouse
48 >> (/dev/input/mouse2)
49 >> (**) Bluetooth Laser Travel Mouse: Applying InputClass "My mouse"
50 >> (EE) No input driver/identifier specified (ignoring)
51 >>
52 >> So I assume my options are merged in the configuration. But it has no
53 >> effect. What can be wrong ?
54 >
55 > Your options DO seem to be merged as we see it applying the specific
56 > inputclass by ID string.
57 >
58 > However, we see it detected twice, using two different device files and
59 > kernel drivers.
60 >
61 > Do you use gpm for text-mode mouse?  AFAIK, it doesn't yet support evdev,
62 > or at least I couldn't figure out how to do it, so if you use it, you need
63 > to keep the kernel input/mouse driver around for that.  But if you don't
64 > use a mouse at the text console anyway, you can probably disable the
65 > kernel mouse driver and thus /dev/input/mouseX and mice, while keeping
66 > evdev and /dev/input/eventX.  That would simplify things for udev and X,
67 > somewhat.
68 >
69 > But if like me you use gpm and thus need to keep /dev/input/mice and the
70 > individual mouseX devices around, you'll just have to live with the extra
71 > devices, as I am.  By default, xorg-server is set, using the catchall, to
72 > only use evdev, and to ignore the mouse device as it won't be assigned a
73 > driver, as that (EE) log entry seems to indicate is happening.  So that
74 > itself shouldn't be an issue.
75 >
76 > What I'm wondering, however, is if either the order of application or the
77 > application of your own settings to the /dev/input/mouseX device (despite
78 > it not having an assigned driver) is screwing things up.
79 >
80 > What happens if...?
81 >
82 > OK, before we get to that, I just noticed something else.  You're editing
83 > the default /etc/X11/xorg.conf.d/10-evdev.conf .
84 >
85 > There's a better way.  Create your OWN file, something like
86 > 00-mc-bluetooth-mouse.conf .  00- puts it in order before the 10- file, so
87 > it's processed first and thus receives precedence over the defaults.  -mc-
88 > is your initials.  Here, I use jed, my initials, to indicate my own
89 > settings.  The idea is simply to make it easy to distinguish your own
90 > settings from any default settings.  Then follows a name that identifies
91 > the function to you, with the .conf extension, or X will ignore it.
92 >
93 > That way, the default files stay unmodified and are easier and less risky
94 > to etc-update or whatever you use.
95 >
96 > So you probably want to create your own separate file, as I mentioned, and
97 > leave the default one untouched.
98 >
99 > Now that we got that out of the way... what happens...
100 >
101 > ... if you add a couple more lines to your section inputclass, above, like
102 > so (MatchDevicePath and Driver, also note that I've column tabulated the
103 > entries for ease of reading, I had my whole xorg.conf aligned like this,
104 > and of course now do it in my xorg.conf.d/*.conf files):
105 >
106 > Section "InputClass"
107 >        Identifier      "My mouse"
108 >        MatchProduct    "Bluetooth Laser Travel Mouse"
109 >        MatchDevicePath "/dev/input/event*"
110 >        Driver          "evdev"
111 >        Option          "AccelerationProfile"           "-1"
112 >        Option          "ConstantDeceleration"          "10"
113 > EndSection
114 >
115 > The idea for the event* devicepath match came from the blog entry
116 > introducing xorg.conf.d to the world, here (see Dan Nicholson's Jan 4 2010
117 > 5:02 PM, comment):
118 >
119 > http://who-t.blogspot.com/2010/01/new-configuration-world-order.html
120 >
121 > Basically, what we're doing is confining our config so it ONLY matches
122 > that product, ONLY on evdev devicefiles, NOT on /dev/input/mouseX files.
123 > That way, it's now safe to tell it specifically to load the evdev driver,
124 > without having to worry about it trying to use that driver on the mouseX
125 > devfile as well.
126 >
127 > With this in place, it shouldn't fall thru to the catchall entry at all,
128 > and we should eliminate all possibility of it getting mixed up by either
129 > that, or the mouseX device.
130 >
131 > If desired, you can add a similar specific mouseX device ignore section
132 > (or another file, there's a reason it's modular now!), as follows:
133 >
134 > Section "InputClass"
135 >        Identifier      "Ignore mousedev"
136 >        MatchDevicePath "/dev/input/mouse*"
137 >        Option          "ignore"                        "1"
138 > EndSection
139 >
140 > BTW, that <<<<< mark, does that indicate snippage?  Did you snip anything
141 > related to the input detection if so?  Because I expected to see it
142 > applying the accel profile and constant decel settings there.  But I'm not
143 > sure if it does that before seeing a driver or not, or whether you snipped
144 > out that bit if it was there, etc.
145 >
146 > Either way, I think/hope the above changes will make the log easier to
147 > follow, even if they don't solve the issue.  So try it and reply with the
148 > new log info if it still doesn't work, and perhaps there'll be some other
149 > hint there.  If nothing else, the documentation is pretty specific that
150 > once the driver is set, it's set, and with the above, your settings should
151 > set it and we should for sure see it set there and not with the catchall
152 > settings.  If with the above it's still not setting the driver until it
153 > reaches catchall, then we know something else strange is going on, as it
154 > would seem to be ignoring your whole custom section.  The only way I can
155 > think that that might happen would be if the match isn't matching for some
156 > reason, but I guess we'll see.
157
158 The <<<<<< mark was intended to highlight this line, telling that the
159 class is being merged on the device. It is the full (relevant) log.
160
161 Sorry for the noise, I found a solution.
162
163 The installed x11-drivers/xf86-input-evdev was 2.3.2 (currently
164 stable). After installing xorg 1.8.0, I just rebuilt it as
165 recommended.
166 I just tried the 2.4.0, currently ~amd64, and the settings apply.
167
168 Here is the final config file :
169
170 Section "InputClass"
171 Identifier "nomouse"
172 MatchDevicePath "/dev/input/mouse*"
173 Option "Ignore" "true"
174 EndSection
175
176 Section "InputClass"
177 Identifier "My mouse"
178 MatchProduct "Bluetooth Laser Travel Mouse"
179 MatchDevicePath "/dev/input/event12"
180 Option "AccelerationProfile" "-1"
181 Option "ConstantDeceleration" "10"
182 EndSection
183
184 (yes, in a separated file this time (for a quick hack, I used first
185 the file I known parsed by Xorg ;-) )
186
187 And the relevant part of the log ( Xorg :1 -retro -verbose 5 2>log ):
188
189 (II) config/udev: Adding input device Bluetooth Laser Travel Mouse
190 (/dev/input/event12)
191 (**) Bluetooth Laser Travel Mouse: Applying InputClass "My mouse"
192 (**) Bluetooth Laser Travel Mouse: Applying InputClass "evdev pointer catchall"
193 (**) Bluetooth Laser Travel Mouse: always reports core events
194 (**) Bluetooth Laser Travel Mouse: Device: "/dev/input/event12"
195 (II) Bluetooth Laser Travel Mouse: Found 12 mouse buttons
196 (II) Bluetooth Laser Travel Mouse: Found scroll wheel(s)
197 (II) Bluetooth Laser Travel Mouse: Found relative axes
198 (II) Bluetooth Laser Travel Mouse: Found x and y relative axes
199 (II) Bluetooth Laser Travel Mouse: Configuring as mouse
200 (**) Bluetooth Laser Travel Mouse: YAxisMapping: buttons 4 and 5
201 (**) Bluetooth Laser Travel Mouse: EmulateWheelButton: 4,
202 EmulateWheelInertia: 10, EmulateWheelTimeout: 200
203 (II) XINPUT: Adding extended input device "Bluetooth Laser Travel
204 Mouse" (type: MOUSE)
205 (**) Bluetooth Laser Travel Mouse: (accel) keeping acceleration scheme 1
206 (**) Option "ConstantDeceleration" "10"
207 (**) Bluetooth Laser Travel Mouse: (accel) constant deceleration by 10.0
208 (**) Option "AccelerationProfile" "-1"
209 (**) Bluetooth Laser Travel Mouse: (accel) acceleration profile -1
210 (**) Bluetooth Laser Travel Mouse: (accel) acceleration factor: 2.000
211 (**) Bluetooth Laser Travel Mouse: (accel) acceleration threshold: 4
212 (II) Bluetooth Laser Travel Mouse: initialized for relative axes.
213 (II) config/udev: Adding input device Bluetooth Laser Travel Mouse
214 (/dev/input/mouse2)
215 (**) Bluetooth Laser Travel Mouse: Ignoring device from InputClass "nomouse"
216
217 We can see the settings are applied.
218
219 Another question is : I have to be root to edit this file. Is it
220 possible to put some settings under $HOME?
221 I have to be root to change the mouse sensitivity setting, and as I
222 can't bear fast mice, some people like them.
223
224 Regards,
225
226 Mickael

Replies