Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: glut and keyboard

  1. #1

    glut and keyboard

    I know that you can use

    case '27':

    to check for the esc key, but what about the arrows, or shift keys.

    Where can i find a list for this?
    Waiting gives the devil time.

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    26

    Re: glut and keyboard

    use glutSpecialFunc which does the same thing as glutKeyboardFunc but for 'special' keys:
    Code :
    void specialFunc(int key, int x, int y)
    {
       switch(key){
          case GLUT_KEY_UP: break;
          case GLUT_KEY_F1: break;
          case GLUT_KEY_PAGE_DOWN: break;
       }
    }
     
    //init
    ...
    glutSpecialFunc(specialFunc);
    ...
    see glut.h for more info (also check glutSpecialUpFunc)

    Carl



    [This message has been edited by dUckmAnn (edited 07-05-2001).]

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2001
    Location
    london ont canada
    Posts
    26

    Re: glut and keyboard

    do a search in the help files for "ascii character codes" or at m$ msdn site (i am sure there are more sites out there with this information).

    it will show a chart of the various characters along with their ascii values.

  4. #4
    Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    428

    Re: glut and keyboard

    For the "special" keys, glut has predefined ascii codes. just go: case GLUT_KEY_UP:
    instead of case whateverasciicode:
    but this only works for the "special" keys.
    :: Sleep is a poor substitute for caffeine ::

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •