1UNTITLED                             LOCAL                            UNTITLED
2

NAME

4     glutMouseFunc — Sets the mouse-button callback for the current window.
5

LIBRARY

7     OpenGLUT - input
8

SYNOPSIS

10     #include <openglut.h>
11
12     void
13     glutMouseFunc(void( *callback )( int button, int state, int x, int y ));
14

PARAMETERS

16      callback     Client hook for mouse-buttons.
17

DESCRIPTION

19     Whenever a mouse button is pressed or released in an OpenGLUT window,
20     OpenGLUT checks if that window has a mouse-button (Mouse) callback regis‐
21     tered.  If so, OpenGLUT gives the event to the handler.   button  is the
22     button number, starting from 0.   state  is  GLUT_UP  or  GLUT_DOWN  to
23     indicate the button's new state.  The other parameters are the mouse
24     coordinates.
25
26     Mouse wheel motion can be reported as buttons.  If you do not request
27     otherwise, a wheel spun forward will act like a button clicking down,
28     immediately followed by clicking up.  Spinning the same wheel backward
29     will act like a different button clicking.  Mouse wheel pseudo-buttons
30     are added after all real buttons.
31
32     While the button is held and the mouse is dragged, you receive mouse-
33     motion events (glutMotionFunc()), even if the mouse is dragged out of the
34     window.
35
36     This callback is bound to the  current window  .
37

CAVEATS

39     Reporting the wheel as buttons is actually inherited from X. freeglut
40     added code to support this on WIN32.  OpenGLUT inherited that support
41     from freeglut.
42
43     Old GLUT defines the symbols  GLUT_LEFT_BUTTON,   GLUT_RIGHT_BUTTON,  and
44      GLUT_MIDDLE_BUTTON.   However, mice can have more than 3 buttons, so
45     these symbols are deprecated.
46
47     Windows created via glutCreateMenuWindow() always cascade keyboard and
48     mouse events to their parent.
49

SEE ALSO

51     glutMotionFunc(3) glutPassiveMotionFunc(3) glutMouseWheelFunc(3)
52
53
54
55
56                                     Epoch
Impressum