Results 1 to 6 of 6

Thread: How can i use mouse middle up-down button

  1. #1
    Junior Member Newbie
    Join Date
    May 2011
    Posts
    11

    How can i use mouse middle up-down button

    I know GLUT_MIDDLE_BUTTON.

    But i want to use up and down controls in mouse's middle button

  2. #2
    Newbie Frequent Contributor
    Join Date
    Mar 2016
    Posts
    896

    Re: How can i use mouse middle up-down button

    Do you mean the mouse wheel? There is glutMouseWheelFunc(), but the linked man page lists some caveats.
    Mouse wheel motion should be reported as clicks of different buttons by glut. Have you tried simply printing the value of "button" that is passed to your glutMouseFunc() callback when you move the wheel?

  3. #3
    Junior Member Newbie
    Join Date
    May 2011
    Posts
    11

    Re: How can i use mouse middle up-down button

    Yes mouse wheel.I use dev-c++.And i take this linker error:
    Code :
    [Linker error] undefined reference to `glutMouseWheelFunc'
    Is this a std method for opengl?I looked glutMouseWheelFunc in internet.Needs openglut.h library.I tried with glut.h library.Which must i use lib for glutMouseWheelFunc in dev-c++?

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: How can i use mouse middle up-down button

    You do have glutMouseWheelFunc with freeglut. The original glut did not support a mouse wheel, so be sure to link against freeglut and not venerable glut.

  5. #5
    Newbie Frequent Contributor
    Join Date
    Mar 2016
    Posts
    896

    Re: How can i use mouse middle up-down button

    Is this a std method for opengl?
    No, it is not part of OpenGL, it is part of glut, which is a library that makes writing simple, portable OpenGL programs relatively easy - probably it's primary use is for learning OpenGL and/or writing tutorials though.
    Anyway, there are a number of implementations of "glut", openglut and freeglut are popular choices.
    Some of these implementations add extra functionality, it's quite possible that glutMouseWheelFunc() is such extra functionality that is not supported by the glut you have.

    You have basically two options:
    - see if you can get things to work with glutMouseFunc() alone - have you tried what I suggested earlier?
    - download, build and install a different glut implementation

  6. #6
    Senior Member Regular Contributor Kopelrativ's Avatar
    Join Date
    Apr 2011
    Posts
    214

    Re: How can i use mouse middle up-down button

    I can also recommend using http://www.glfw.org/ instead of glut. I think it is a more modern library than the glut family, and more flexible.

Similar Threads

  1. Right mouse Button and Mouse Movement for Zoom?
    By GrimmBro in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 02-20-2011, 04:45 AM
  2. glutMousefunc(mouse)/button
    By OGforever in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-14-2005, 09:52 PM
  3. mouse button 'repeat'
    By PopeKetric in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 12-16-2002, 09:36 AM
  4. Full Screen Mode and Middle Mouse Button
    By jleffelm in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-27-2002, 12:09 PM
  5. Button Testing with a mouse
    By jeremyp in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-19-2001, 07:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean