PDA

View Full Version : glutkeyboardfunc(); bug???



LostInTheWoods
01-13-2003, 10:44 AM
I am attempting to use the DEL key inside a glut app. EVERY other key works for me, exept the DEL key. It isnt part of the specialfunc, and it should be returned by ascii 83. Is this a bug? Or am i using the wrong scan code??

marcus256
01-13-2003, 10:49 AM
Originally posted by LostInTheWoods:
I am attempting to use the DEL key inside a glut app. EVERY other key works for me, exept the DEL key. It isnt part of the specialfunc, and it should be returned by ascii 83. Is this a bug? Or am i using the wrong scan code??

Uh, I think it's ASCII 127 (read up on your ASCII tables). ASCII 83 (decimal) is "S".

Stack Overflow
01-13-2003, 10:49 AM
Hello LostInTheWoods,

Try using ascii key #127. Example:

void keyboard( unsigned char key, int x, int y ) {
switch ( key ) {
case 127:
exit( 0 );
break;
}
}

glutKeyboardFunc( keyboard );

Edit: ASCII Table (http://www.asciitable.com)

- VC6-OGL

[This message has been edited by VC6-OGL (edited 01-13-2003).]