From: John Tsiombikas Date: Wed, 10 Oct 2018 05:23:33 +0000 (+0000) Subject: Fixed mousewheel callbacks under X11. (bug #247, github issue #66) X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;ds=sidebyside;h=e1b231e938f0851ea4fb97c9ee2aae59110dd24a;hp=e1b231e938f0851ea4fb97c9ee2aae59110dd24a;p=freeglut Fixed mousewheel callbacks under X11. (bug #247, github issue #66) The code had the incorrect assumption that button numbers mapped to the wheel follow after the last "real" button as returned by the GLUT_NUM_MOUSE_BUTTONS query, which in turn resolves to a call to XGetPointerMapping. In reality the X server always sends button presses for 4 and 5 when a wheel is turned down/up respectively, and the rest of the mouse buttons (if any) follow afterwards. Also XGetPointerMapping doesn't seem to reliably return the number of actual buttons, and in any case the wheel "buttons" are certainly included in the count as they can be remapped. Since we can't know if buttons after 5 are further wheels or regular buttons this modification only ever invokes the wheel callback for wheel 0. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1844 7f0cb862-5218-0410-a997-914c9d46530a ---