All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

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.