Re: Mouse scroll wheel in wily

  • From: Sam Holden <sholden@xxxxxxxxxxxxxx>
  • To: wilyfans@xxxxxxxxxxxxx
  • Date: Tue, 13 Jul 2004 10:21:03 +1000

Davor Cubranic writes:
>My modification was virtually identical, except for the addition of code
>to vshow.c to handle mousewheel events over the scrollbar (otherwise
>mouse wheel works only over the body of the window):

That shows my unfamiliarity with the wily source, I didn't think of that.

Making that patch at least showed me why wily had always interpreted my
mouse wheel scroll attempts as B3s...

[snip patch]

>Also, I'm not sure if the checks for cancelled DOWN/UP in mouse.c can
>actually happen with the current mousewheel hardware. That is, you can't
>press mousewheel down, then before releasing it press another button in
>order to cancel the operation, the way you can with regular mouse
>buttons. Actually, maybe you can with that IBM mouse that has a little
>up/down joystick rather than a wheel.

I don't think they can be cancelled either, I just copied the code
from the B3 code and thought better safe than sorry (again I'm not
familiar with the wily code, I was amazed when it compiled and even
more amazed when it didn't crash).

Of course simpler code is probably a better goal. 

I'm also using 5 instead of 1 in my code now, since 1 is just painfully
slow (for my purposes anyway - I use the scroll wheel when reading
through a file when my hand happens to be on the mouse - often because
I'm looking for something to cut-n-paste but not sure what exactly).

>I then built on the mousewheel scroll patch to search backward and
>forward with B3+wheel, although that was more of an exercise than a
>functionality that's obviously needed in wily.

It seems useful enough. Of course a mouse wheel opens up four more chords -
which clearly need to be used for something, in order to keep those
creature's feeping.

And as an aside:

My recollections of gary's views on coding are obviously faulty, or
he didn't practice what he preached... view_linesdown taking
a boolean to indicate whether it really view_linesdown or view_linesup
is bizarre - especially since there isn't anywhere I can see in
which that argument isn't a constant. I had thought he didn't like
functions taking "what to do" type flags, preferring a seperate
function for each "what".


Other related posts: