From: John Tsiombikas Date: Sat, 29 Sep 2018 06:05:26 +0000 (+0000) Subject: fixed spaceball button callback (x11) compatibility with original GLUT: button X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=freeglut;a=commitdiff_plain;h=0f239b79d6e1db71dece3ca2016aa7eacd81a57d fixed spaceball button callback (x11) compatibility with original GLUT: button numbers should start from 1, not 0. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1843 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/x11/fg_spaceball_x11.c b/src/x11/fg_spaceball_x11.c index e6eabb2..e8c328a 100644 --- a/src/x11/fg_spaceball_x11.c +++ b/src/x11/fg_spaceball_x11.c @@ -136,7 +136,8 @@ void fgSpaceballHandleXEvent(const XEvent *xev) break; case SPNAV_EVENT_BUTTON: - INVOKE_WCB(*spnav_win, SpaceButton, (sev.button.bnum, sev.button.press ? GLUT_DOWN : GLUT_UP)); + /* button numbers are 1-based in glutSpaceballButtonFunc */ + INVOKE_WCB(*spnav_win, SpaceButton, (sev.button.bnum + 1, sev.button.press ? GLUT_DOWN : GLUT_UP)); break; default: