Glut Implementation Notes For X11

X11 sends KeyPress events repeatedly when the window system's global auto repeat is enabled. glutIgnoreKeyRepeat can prevent these auto repeated keystrokes from being reported as keyboard or special callbacks, but there is still some minimal overhead by the X server to continually stream KeyPress events to the GLUT application. The glutSetKeyRepeat routine can be used to actually disable the global sending of auto repeated KeyPress events. Note that glutSetKeyRepeat affects the global window system auto repeat state so other applications will not auto repeat if you disable auto repeat globally through glutSetKeyRepeat.

GLUT applications using the X11 GLUT implemenation should disable key repeat with glutSetKeyRepeat to disable key repeats most efficiently.

GLUT applications that change the key repeat state with glutSetKeyRepeat are responsible for explicitly restoring the default key repeat state on exit.

Glut Implementation Notes For Win32

The Win32 implementation of glutSetKeyRepeat does nothing. The glutIgnoreKeyRepeat routine can be used in the Win32 GLUT implementation to ignore repeated keys on a per-window basis without changing the global window system key repeat.