Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

glut keys

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Eber Kain   Members   

130
Like
Likes
Like

Posted 04 July 2001 - 06:57 PM

where can i find a listing of what all the keys #''s are. i know 27 is (esc), but i need to know some other, like the arrow keys, and ctrl/shift/alt home.earthlink.net/~eberkain/

#2 Obelix   Members   

122
Like
Likes
Like

Posted 05 July 2001 - 10:53 AM

You can look in the header file. GLUT has a function for getting the status of some keys like ctrl. I think the name is glutGetModifier.

#3 Dragonus   Members   

122
Like
Likes
Like

Posted 09 July 2001 - 09:36 AM

Arrow keys and keys like Page Down/Page Up/Home/End are handled in a different function that normal keyboard commands. Ordinarily, keys like 'a' and 'b' would be directed to the function you provide in the glutKeyboardFunc(...) function, they're going to go to the function in the glutSpecialFunc(...) command.

For example, here's how I handled that problem...

  
void keyboard2GL(int key, int x, int y)
{
if(key == GLUT_KEY_LEFT) xdir -= 2.0f / zoom;
else if(key == GLUT_KEY_RIGHT) xdir += 2.0f / zoom;
else if(key == GLUT_KEY_DOWN) ydir -= 2.0f / zoom;
else if(key == GLUT_KEY_UP) ydir += 2.0f / zoom;
else if(key == GLUT_KEY_HOME) {xdir -= 2.0f / zoom; ydir += 2.0f / zoom;}
else if(key == GLUT_KEY_END) {xdir -= 2.0f / zoom; ydir -= 2.0f / zoom;}
else if(key == GLUT_KEY_PAGE_UP) {xdir += 2.0f / zoom; ydir += 2.0f / zoom;}
else if(key == GLUT_KEY_PAGE_DOWN) {xdir += 2.0f / zoom; ydir -= 2.0f / zoom;}
}

void createWindow(void* arg)
{
// Code goes here...

glutKeyboardFunc(keyboardGL);
glutSpecialFunc(keyboard2GL);
// More code goes here...

glutMainLoop();
}


Hope this helps! :D

~ Dragonus

Edited by - Dragonus on July 9, 2001 4:37:48 PM




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.