Re: Wheel mice



On Mon, Sep 18, 2000 at 06:16:34PM +0200, Andrew Walker wrote:
> Bruce Ide wrote:
> > I wouldn't say GTK would be the right place to do that. You want it to
> > happen at the lowest level possible, or the behavioral inconsistencies
> > between your applications WILL drive you crazy.
> > 
> > If I were looking to implement this stuff natively, I'd do it in the X
> > server. Don't they have wheel functionality in Xfree 4.x? Wheel mice
> > have been around forever now...
> 
> XFree86 4.0.1 supports the wheel reasonably well.

I think this dates back before 4.x, although it may be that 4.x doesn't
require you to configure the server for it, unlike what

	http://www-sop.inria.fr/koala/colas/mouse-wheel-scroll/

seems to imply you have to do for 3.3.2 and later.

> Say you have a
> 3 button mouse with a wheel. You tell the X server (via XF86Config)
> that you have a 5 button mouse (2 more than the physical buttons)
> then you set the ZAxisMapping to "4 5". Mousewheel up gives button4,
> mousewheel down gives button5. Its documented in:
> 
> 	/usr/X11R6/lib/X11/doc/README.mouse
> 
> So you just need a way to bind buttons 4 and 5 for your application.

...or your toolkit, if you're a toolkit writer.  If it's done in the
toolkit, you may not have to configure individual applications to handle
the wheelmouse; as per earlier mail, GTK+ handles this (see
"gtk_main_do_event()", in the code to handle GDK_BUTTON_PRESS,
GDK_2BUTTON_PRESS, and GDK_3BUTTON_PRESS), and according to

	http://doc.trolltech.com/porting.html

"your Wheel Mouse works" with Qt 2.x.

See

	http://www-sop.inria.fr/koala/colas/mouse-wheel-scroll/

for more on X and wheel mice.  It gives some X translations to add to
make xterm, some Athena widgets, Netscape, and Nedit (the Netscape
and/or Nedit translations may, if you replace the application name with
a "*" in the name of the translation, add support to other Motif
applications as well) support wheel mice, mentions an "mwheel.el"
packaget for XEmacs and GNU Emacs, some additional Tcl code to add wheel
mouse support for Tcl/Tk.

Note that this won't necessarily completely eliminate "behavioral
inconsistencies between your applications", as much application
behavior, for better or worse, in X applications is implemented on the
client side (either in the application or the toolkit).

The only way to make wheel mice completely transparent would be to have
the X server generate events that look exactly like standard X events
you could get from a system with a normal keyboard and a normal mouse;
however:

	1) that's not what the XFree86 server does, and the "buttons 4
	   and 5" stuff it does appears to be a *de facto* standard, so
	   I don't expect it to change (unless somebody decides that
	   wheel mice need an X extension to support them);

	2) I don't know whether it *could* generate such events -
	   perhaps synthesizing arrow-key down events would do it;

	3) you can get plenty of "behavioral inconsistencies between
	   your applications" without the benefit of a wheel mouse,
	   courtesy of differences in toolkit behavior (e.g., toolkits
	   not properly using the PRIMARY and CLIPBOARD selections
	   *cough* Qt *cough*), so if somebody doesn't want to be
	   "[driven] crazy" by those inconsistencies, they'll probably
	   have to push toolkit (and possibly application) writers to
	   clean up their acts *anyway*, so you might as well just get
	   them to support buttons 4 and 5 as wheel mouse event
	   indicators.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]