* [PATCH] mousedev: Fix scrollwheel thingy on IBM ScrollPoint mice
@ 2004-10-26 8:45 Kim Holviala
2004-10-27 0:11 ` Andrew Morton
0 siblings, 1 reply; 7+ messages in thread
From: Kim Holviala @ 2004-10-26 8:45 UTC (permalink / raw)
To: linux-kernel, vojtech
The scrollwheel thingy (stick) on IBM ScrollPoint mice returns extremely
aggressive values even when touched lightly. This confuses XFree which
assumes the wheel values can only be 1 or -1. Incidently, it also
confuses Windows' default mouse driver which proves the problem is in
the mouse itself.
This patch limits the scroll wheel movements to be either +1 or -1 on
the event -> emulated PS/2 level. I chose to implement it there because
mousedev emulates Microsoft mice but the real ones almoust never return
a bigger value than 1 (or -1).
Kim
diff -ruN linux-2.6.8.1-original/drivers/input/Kconfig linux-2.6.8.1/drivers/input/Kconfig
--- linux-2.6.8.1-original/drivers/input/Kconfig 2004-10-26 08:42:30.000000000 +0300
+++ linux-2.6.8.1/drivers/input/Kconfig 2004-10-26 09:54:58.000000000 +0300
@@ -72,6 +72,17 @@
screen resolution you are using to correctly scale the data. If
you're not using a digitizer, this value is ignored.
+config INPUT_MOUSEDEV_WHEELFIX
+ bool "Limit too fast wheel movement"
+ depends on INPUT_MOUSEDEV
+ default n
+ help
+ Say Y here if your mouse wheel only works randomly or if it scrolls
+ too fast. Some mice, like IBM's scrollpoints, return too big wheel
+ movement values which confuse programs like XFree.
+
+ If your mouse wheel thingy works as advertised, say N.
+
config INPUT_JOYDEV
tristate "Joystick interface"
depends on INPUT
diff -ruN linux-2.6.8.1-original/drivers/input/mousedev.c linux-2.6.8.1/drivers/input/mousedev.c
--- linux-2.6.8.1-original/drivers/input/mousedev.c 2004-10-26 08:42:31.000000000 +0300
+++ linux-2.6.8.1/drivers/input/mousedev.c 2004-10-26 11:21:01.000000000 +0300
@@ -137,7 +137,11 @@
switch (code) {
case REL_X: mousedev->packet.dx += value; break;
case REL_Y: mousedev->packet.dy -= value; break;
- case REL_WHEEL: mousedev->packet.dz -= value; break;
+ case REL_WHEEL:
+#ifdef CONFIG_INPUT_MOUSEDEV_WHEELFIX
+ if (value) { value = (value < 0 ? -1 : 1); }
+#endif /* CONFIG_INPUT_MOUSEDEV_WHEELFIX */
+ mousedev->packet.dz -= value; break;
}
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mousedev: Fix scrollwheel thingy on IBM ScrollPoint mice
2004-10-26 8:45 [PATCH] mousedev: Fix scrollwheel thingy on IBM ScrollPoint mice Kim Holviala
@ 2004-10-27 0:11 ` Andrew Morton
2004-10-27 0:33 ` Dmitry Torokhov
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2004-10-27 0:11 UTC (permalink / raw)
To: Kim Holviala; +Cc: linux-kernel, vojtech
Kim Holviala <kim@holviala.com> wrote:
>
> The scrollwheel thingy (stick) on IBM ScrollPoint mice returns extremely
> aggressive values even when touched lightly. This confuses XFree which
> assumes the wheel values can only be 1 or -1. Incidently, it also
> confuses Windows' default mouse driver which proves the problem is in
> the mouse itself.
>
> This patch limits the scroll wheel movements to be either +1 or -1 on
> the event -> emulated PS/2 level. I chose to implement it there because
> mousedev emulates Microsoft mice but the real ones almoust never return
> a bigger value than 1 (or -1).
> ...
> +#ifdef CONFIG_INPUT_MOUSEDEV_WHEELFIX
> + if (value) { value = (value < 0 ? -1 : 1); }
> +#endif /* CONFIG_INPUT_MOUSEDEV_WHEELFIX */
This is really not a thing which we can put behind compile-time config.
Can we come up with a fix which works correctly on all hardware? If not,
this workaround will need to be enabled by some sort of runtime detection.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mousedev: Fix scrollwheel thingy on IBM ScrollPoint mice
2004-10-27 0:11 ` Andrew Morton
@ 2004-10-27 0:33 ` Dmitry Torokhov
2004-10-27 5:51 ` Vojtech Pavlik
0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Torokhov @ 2004-10-27 0:33 UTC (permalink / raw)
To: linux-kernel; +Cc: Andrew Morton, Kim Holviala, vojtech
On Tuesday 26 October 2004 07:11 pm, Andrew Morton wrote:
> Kim Holviala <kim@holviala.com> wrote:
> >
> > The scrollwheel thingy (stick) on IBM ScrollPoint mice returns extremely
> > aggressive values even when touched lightly. This confuses XFree which
> > assumes the wheel values can only be 1 or -1. Incidently, it also
> > confuses Windows' default mouse driver which proves the problem is in
> > the mouse itself.
> >
> > This patch limits the scroll wheel movements to be either +1 or -1 on
> > the event -> emulated PS/2 level. I chose to implement it there because
> > mousedev emulates Microsoft mice but the real ones almoust never return
> > a bigger value than 1 (or -1).
> > ...
> > +#ifdef CONFIG_INPUT_MOUSEDEV_WHEELFIX
> > + if (value) { value = (value < 0 ? -1 : 1); }
> > +#endif /* CONFIG_INPUT_MOUSEDEV_WHEELFIX */
>
> This is really not a thing which we can put behind compile-time config.
>
> Can we come up with a fix which works correctly on all hardware? If not,
> this workaround will need to be enabled by some sort of runtime detection.
>
Unless someone (Vojtech?) has an objection I think we should always have
this workaround activated - after all mousedev provides legacy emulation
mostly for XFree/XOrg benefit anyway. Clients accessing data through evdev
will see the full picture regardless.
--
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mousedev: Fix scrollwheel thingy on IBM ScrollPoint mice
2004-10-27 0:33 ` Dmitry Torokhov
@ 2004-10-27 5:51 ` Vojtech Pavlik
2004-10-27 6:29 ` Dmitry Torokhov
2004-10-27 6:32 ` Kim Holviala
0 siblings, 2 replies; 7+ messages in thread
From: Vojtech Pavlik @ 2004-10-27 5:51 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-kernel, Andrew Morton, Kim Holviala
On Tue, Oct 26, 2004 at 07:33:50PM -0500, Dmitry Torokhov wrote:
> > > This patch limits the scroll wheel movements to be either +1 or -1 on
> > > the event -> emulated PS/2 level. I chose to implement it there because
> > > mousedev emulates Microsoft mice but the real ones almoust never return
> > > a bigger value than 1 (or -1).
> > > ...
> > > +#ifdef CONFIG_INPUT_MOUSEDEV_WHEELFIX
> > > + if (value) { value = (value < 0 ? -1 : 1); }
> > > +#endif /* CONFIG_INPUT_MOUSEDEV_WHEELFIX */
> >
> > This is really not a thing which we can put behind compile-time config.
> >
> > Can we come up with a fix which works correctly on all hardware? If not,
> > this workaround will need to be enabled by some sort of runtime detection.
> >
>
> Unless someone (Vojtech?) has an objection I think we should always have
> this workaround activated - after all mousedev provides legacy emulation
> mostly for XFree/XOrg benefit anyway. Clients accessing data through evdev
> will see the full picture regardless.
We can have a workaround for XOrg, but not one like this. This will make
fast scrolling unreliable. I have standard Microsoft-compatible mice
which do report more than one scroll tick per report, if you scroll the
wheel fast enough, and this throws away the extra ticks.
We would have to split the value into multiple events which would each
report a 1 or -1.
--
Vojtech Pavlik
SuSE Labs, SuSE CR
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mousedev: Fix scrollwheel thingy on IBM ScrollPoint mice
2004-10-27 5:51 ` Vojtech Pavlik
@ 2004-10-27 6:29 ` Dmitry Torokhov
2004-10-27 6:32 ` Kim Holviala
1 sibling, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2004-10-27 6:29 UTC (permalink / raw)
To: linux-kernel; +Cc: Vojtech Pavlik, Andrew Morton, Kim Holviala
On Wednesday 27 October 2004 12:51 am, Vojtech Pavlik wrote:
> On Tue, Oct 26, 2004 at 07:33:50PM -0500, Dmitry Torokhov wrote:
>
> > > > This patch limits the scroll wheel movements to be either +1 or -1 on
> > > > the event -> emulated PS/2 level. I chose to implement it there because
> > > > mousedev emulates Microsoft mice but the real ones almoust never return
> > > > a bigger value than 1 (or -1).
> > > > ...
> > > > +#ifdef CONFIG_INPUT_MOUSEDEV_WHEELFIX
> > > > + if (value) { value = (value < 0 ? -1 : 1); }
> > > > +#endif /* CONFIG_INPUT_MOUSEDEV_WHEELFIX */
> > >
> > > This is really not a thing which we can put behind compile-time config.
> > >
> > > Can we come up with a fix which works correctly on all hardware? If not,
> > > this workaround will need to be enabled by some sort of runtime detection.
> > >
> >
> > Unless someone (Vojtech?) has an objection I think we should always have
> > this workaround activated - after all mousedev provides legacy emulation
> > mostly for XFree/XOrg benefit anyway. Clients accessing data through evdev
> > will see the full picture regardless.
>
> We can have a workaround for XOrg, but not one like this. This will make
> fast scrolling unreliable. I have standard Microsoft-compatible mice
> which do report more than one scroll tick per report, if you scroll the
> wheel fast enough, and this throws away the extra ticks.
>
> We would have to split the value into multiple events which would each
> report a 1 or -1.
>
I have taken a look at XFree/XOrg sources and it seems that they should
not have -1/1 problem but values outside of limits allowed for Intellimouse
or Explorer protocols will cause re-evaluation of protocol mode. We probably
just clamp values to protocol limits (-8/+7 for intellimouse and explorer
modes) and be done with it.
--
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mousedev: Fix scrollwheel thingy on IBM ScrollPoint mice
2004-10-27 5:51 ` Vojtech Pavlik
2004-10-27 6:29 ` Dmitry Torokhov
@ 2004-10-27 6:32 ` Kim Holviala
2004-10-28 12:42 ` Kim Holviala
1 sibling, 1 reply; 7+ messages in thread
From: Kim Holviala @ 2004-10-27 6:32 UTC (permalink / raw)
To: Vojtech Pavlik; +Cc: Dmitry Torokhov, linux-kernel, Andrew Morton
Vojtech Pavlik wrote:
>>>>This patch limits the scroll wheel movements to be either +1 or -1 on
>>>>the event -> emulated PS/2 level. I chose to implement it there because
>>>>mousedev emulates Microsoft mice but the real ones almoust never return
>>>>a bigger value than 1 (or -1).
>>>>...
>>>>+#ifdef CONFIG_INPUT_MOUSEDEV_WHEELFIX
>>>>+ if (value) { value = (value < 0 ? -1 : 1); }
>>>>+#endif /* CONFIG_INPUT_MOUSEDEV_WHEELFIX */
>>>
>>>This is really not a thing which we can put behind compile-time config.
>>>
>>>Can we come up with a fix which works correctly on all hardware? If not,
>>>this workaround will need to be enabled by some sort of runtime detection.
>>>
>>
>>Unless someone (Vojtech?) has an objection I think we should always have
>>this workaround activated - after all mousedev provides legacy emulation
>>mostly for XFree/XOrg benefit anyway. Clients accessing data through evdev
>>will see the full picture regardless.
>
>
> We can have a workaround for XOrg, but not one like this. This will make
> fast scrolling unreliable. I have standard Microsoft-compatible mice
> which do report more than one scroll tick per report, if you scroll the
> wheel fast enough, and this throws away the extra ticks.
It wasn't an optimal solution, but just a quick hack that made the
scrollpoint usable. BTW, I've tried with about a dozen wheelmice and all
of them needed real misuse to get a packet where the scroll amount was
more than 1....
Not that I'm claiming that those kind of mice don't exist. They do, one
of them is this ScrollPoint that I'm using now.
> We would have to split the value into multiple events which would each
> report a 1 or -1.
That would be the right solution - I thought about it but deciced not to
steal any more of my employers time.... Besides, I needed to slow the
wheel/stick action down anyway since a light touch of the stick
generates insane scroll events. In Windows with the default driver the
stick operated like Home/End...
Kim
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mousedev: Fix scrollwheel thingy on IBM ScrollPoint mice
2004-10-27 6:32 ` Kim Holviala
@ 2004-10-28 12:42 ` Kim Holviala
0 siblings, 0 replies; 7+ messages in thread
From: Kim Holviala @ 2004-10-28 12:42 UTC (permalink / raw)
To: Kim Holviala; +Cc: Vojtech Pavlik, Dmitry Torokhov, linux-kernel, Andrew Morton
Kim Holviala wrote:
>>>>> This patch limits the scroll wheel movements to be either +1 or -1 on
>>>>> the event -> emulated PS/2 level. I chose to implement it there
>>>>> because
>>>>> mousedev emulates Microsoft mice but the real ones almoust never
>>>>> return
>>>>> a bigger value than 1 (or -1).
>>>>> ...
>>>>> +#ifdef CONFIG_INPUT_MOUSEDEV_WHEELFIX
>>>>> + if (value) { value = (value < 0 ? -1 : 1); }
>>>>> +#endif /* CONFIG_INPUT_MOUSEDEV_WHEELFIX */
>>>>
>>
>> We can have a workaround for XOrg, but not one like this. This will make
>> fast scrolling unreliable. I have standard Microsoft-compatible mice
>> which do report more than one scroll tick per report, if you scroll the
>> wheel fast enough, and this throws away the extra ticks.
One more comment to the scrollpoint issue: if they haven't fixed it
after 4.3.something XFree throws away all scroll events where the scroll
amount is more than 1. So "fast scrolling" is already unreliable, this
patch just made it work somehow instead of what it's doing now: not
working at all.
Kim
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-10-28 12:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-26 8:45 [PATCH] mousedev: Fix scrollwheel thingy on IBM ScrollPoint mice Kim Holviala
2004-10-27 0:11 ` Andrew Morton
2004-10-27 0:33 ` Dmitry Torokhov
2004-10-27 5:51 ` Vojtech Pavlik
2004-10-27 6:29 ` Dmitry Torokhov
2004-10-27 6:32 ` Kim Holviala
2004-10-28 12:42 ` Kim Holviala
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.