From cbd4a2813272a15c66665af07fe5716fafcecada Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 29 Dec 1998 13:34:35 +0000 Subject: Update glpuzzle demo to work with two button mice. git-svn-id: file:///fltk/svn/fltk/trunk@169 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/glpuzzle.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/glpuzzle.cxx b/test/glpuzzle.cxx index 1ccfde39f..b9533e667 100644 --- a/test/glpuzzle.cxx +++ b/test/glpuzzle.cxx @@ -1,5 +1,5 @@ // -// "$Id: glpuzzle.cxx,v 1.4 1998/12/08 21:04:40 mike Exp $" +// "$Id: glpuzzle.cxx,v 1.5 1998/12/29 13:34:35 mike Exp $" // // OpenGL puzzle demo for the Fast Light Tool Kit (FLTK). // @@ -1267,7 +1267,10 @@ mouse(int b, int s, int x, int y) } left_mouse = GL_TRUE; sel_piece = selectPiece(mousex, mousey); - if (computeCoords(sel_piece, mousex, mousey, &selx, &sely)) { + if (!sel_piece) { + left_mouse = GL_FALSE; + middle_mouse = GL_TRUE; // let it rotate object + } else if (computeCoords(sel_piece, mousex, mousey, &selx, &sely)) { grabPiece(sel_piece, selx, sely); } glutPostRedisplay(); @@ -1278,16 +1281,13 @@ mouse(int b, int s, int x, int y) break; } } else { - switch (b) { - case GLUT_LEFT_BUTTON: + if (left_mouse) { left_mouse = GL_FALSE; dropSelection(); glutPostRedisplay(); - break; - case GLUT_MIDDLE_BUTTON: + } else if (middle_mouse) { middle_mouse = GL_FALSE; glutPostRedisplay(); - break; } } motion(x, y); @@ -1479,5 +1479,5 @@ main(int argc, char **argv) #endif // added for fltk's distribution // -// End of "$Id: glpuzzle.cxx,v 1.4 1998/12/08 21:04:40 mike Exp $". +// End of "$Id: glpuzzle.cxx,v 1.5 1998/12/29 13:34:35 mike Exp $". // -- cgit v1.2.3