1) Disable keyboard repeat globally(all windows which using glut):
int glutSetKeyRepeat(int repeatMode);
repeatMode: on, off, default mode
GLUT_KEY_REPEAT_OFF,
GLUT_KEY_REPEAT_ON,
GLUT_KEY_REPEAT_DEFAULT.
2) Disable keyboard repeat locally(only the caller window):
int glutIgnoreKeyRepeat(int repeatMode);
repeatMode: 0 enable auto repeat; none-0 disable auto repeat.
3) Key up callback register function:
void glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y));
void glutSpecialUpFunc(void (*func)(int key, int x, int y));