9 Jul 2004 09:06
Re: Mouse scroll wheel in wily
Sam Holden <sholden <at> cs.usyd.edu.au>
2004-07-09 07:06:12 GMT
2004-07-09 07:06:12 GMT
ozan s yigit writes: >> I modified wily/libXg to recognize scroll mouse events and scroll the >> view accordingly. Would anybody here be interested in a patch? The patch >> itself is very simple, since all it does is add handling of Button4 and >> Button5 mouse events returned by X windows. > >please send me the patch when you get a chance. >thanks. Did anything come of this? It's a patch I'm certainly interested in, I whipped up my own implementation just now, but wily internals scare me (it has gary's fingerprints after all :) and I probably introduced a huge bug of some sort or another... It's only 20 lines of touched code or so, so here's a diff of my implementation, feel free to point out the defects that certainly exist. diff -c -r wily-0.13.41/libXg/gwin.c wily-0.13.41-mod/libXg/gwin.c *** wily-0.13.41/libXg/gwin.c Tue Oct 1 14:57:48 1996 --- wily-0.13.41-mod/libXg/gwin.c Fri Jul 9 16:24:15 2004 *************** *** 355,360 **** --- 355,362 ---- case 1: s |= Button1Mask; break; case 2: s |= Button2Mask; break; case 3: s |= Button3Mask; break; + case 4: s |= Button4Mask; break; + case 5: s |= Button5Mask; break; } break;(Continue reading)
> 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".
I think I'd still call those both the same function, but I'd maybe
give it a different name these days: viewLinesMove or viewLinesUpOrDown.
I haven't looked much at wily source in a long time, now I think
I'd be afraid/embarrassed to look :-/
RSS Feed