Re: [PATCH] Wheelmouse support for zvtterm



On Wed, 10 Mar 1999, Richard Hult wrote:

> I have made a small patch that makes gnome-terminal and other apps that
> use zvtterm support scrollwheel mice. I'm not a guru so it might be
> totally off. At least it works for me ;)
> 
> Feel free to commit it or throw it away, or even better, please make it
> work the right way if it's wrong :)

I just skimmed through the patch and I think the better approach would be
to send the button4/5 events to the corresponding scrollbar, so we needn't
care of the amount to be scrolled when these events occur (it will always
be the same as if you use the wheel inside the scrollbar).

Maybe a convenience function in the form of

  gtk_redirect_wheel_events (GdkEventButton *event,
                             GtkRange *vrange,
                             GtkRange *hrange)

would help -- yes, it's a bit kludgy (i.e. far from elegant) and you have
to install a handler for button clicks (if you don't have one already),
but many users are happy with their wheel mice and would like to use them
without moving the mouse on top of the scroll bar (my wife and me not the 
least ones -- even XEmacs supports them nowadays).

This function would test event for button 4 or 5 events, and send them to
vrange, or if Shift, Ctrl, Alt or Meta is pressed (we could make this
configurable:-) to hrange (this would be handy in e.g. the Gimp). The
event->type would then be set to GDK_NOTHING, so the button4/5 events
won't reach the widget. The developer should call it before anything else
in the click handler, of course.

As of now, this thing only exists in my brain, and I would prefer to have
some input from the design department (if my approach makes any sense)
and the application developers (if they would use this) before coding.

Nils
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nils Philippsen                  @college: nils@fht-esslingen.de
Vogelsangstrasse 115             @home:    nils@wombat.dialup.fht-esslingen.de
D 70197 Stuttgart                phone:    +49-711-6599405
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lottery is a tax on people who are bad at math.



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