From: Steve B. <sjb...@ai...> - 2003-10-02 20:14:57
|
Fay John F Contr AAC/WMG wrote: > OK, I have figured out how to capture scroll wheel events in MSVC. I > assume Richard can do the same in Linux; failing that I can probably > take a lick at it. What I need to have answered now is the burning > question: how do we pass it from "freeglut" to the application? I'd go for: void glutMouseWheelFunc ( GLUTCALLBACK *func ) ; ...where 'func' looks like: void mouseWheelCallback ( int wheel, int num_clicks, int x, int y ) ; ...where 'wheel' is zero for the vertical scrollwheel, one for the horizontal scroll wheel that *some* mice are coming out with - and some larger number for some future unspecified wheel number. ...and 'num_clicks' is the (signed) number of clicks since the last time we called this function. Scrolling the wheel in the forward/rightwards direction produces positive numbers - scrolling it backwards/leftwards - negative. Generally, this number will be either +1 or -1 because zero clicks results in no call to the function and we probably don't have a way to have multiple clicks be accumulated. ...and (x,y) is the coordinate the mouse was at when the last of those clicks was recieved (for compatibility with glutMouseFunc). Then we need a way to tell freeglut that the mouse buttons are to be interpreted as mouse wheel input rather than true buttons - if we can't read that from the windowing system somehow - then I suggest a 'GLUT_MOUSEWHEEL' shell variable with the default (if it's not set) being to assume that mice with 5 or more "buttons" are actually 3 button mice with one or more scroll wheels. Does this sound good? ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |