Problems with glutKeyboardFunc

//Part of the code
glutDisplayFunc(display);
glutIdleFunc(idle);
glutKeyboardFunc(keyBoard);
glutMainLoop();

The program is working correctly except it responds about one second after I pressed a key(e.g. ‘t’).

Anyone knows why this could happen?

Probably, ur idle or display function is taking longer to finish.

Its seems fine now after adding a glFinish()…