Thread: openGL ctrl key

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    21

    openGL ctrl key

    i'm using glut and how i can identity the key "ctrl" ?

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Code:
    /* executed when a special key is pressed */
    void keyboardSpecialDown(int k, int x, int y) {
    
    }
    
    /* executed when a special key is released */
    void keyboardSpecialUp(int k, int x, int y) {
    
    }

    more here:
    http://jeff.bagu.org/downloads/glut/EmptyGlut.cpp

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    21
    i'm question about the code of control key.

    the callback i know how to work with them

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    But the "Ctrl" key _IS_ a special key, so should be possible to capture with that callback.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    21
    i will explain better, for up key the code is GLUT_KEY_UP and for ctrl is what?

  6. #6
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    I don't actually see a control key in glut.h. Just make your app print out whatever the call back receives and see if it's supported.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM