Name

glutSetKeyRepeat - sets the key repeat mode

Python Specification

glutSetKeyRepeat
	glutSetKeyRepeat(repeatMode) -> None

C Specification

int glutSetKeyRepeat(int repeatMode);

Parameters

repeatMode
          Mode for setting key repeat to.

GLUT_KEY_REPEAT_OFF
        Disable  key  repeat  for  the  window system on a
        global basis if possible.

GLUT_KEY_REPEAT_ON
        Enable key repeat  for  the  window  system  on  a
        global basis if possible.

GLUT_KEY_REPEAT_DEFAULT
        Reset the key repeat mode for the window system to
        its default state if possible.

Description

glutSetKeyRepeat sets the key repeat mode for  the  window
system on a global basis if possible.  If supported by the
window system, the key repeat can either be enabled,  dis-
abled,  or  set  to the window system's default key repeat
state.

Glut Implementation Notes For X11

X11 sends KeyPress events repeatedly when the window  sys-
tem'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 glut-
SetKeyRepeat 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  glut-
SetKeyRepeat.

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-win-
dow basis without changing the global  window  system  key
repeat.

See Also

glutIgnoreKeyRepeat,   glutKeyboardFunc,  glutSpecialFunc,
glutKeyboardUpFunc, glutSpecialUpFunc, glutDeviceGet

Author

Mark J. Kilgard (mjk@nvidia.com)

:: Documentation :: References :: GLUT ::
:: Index (n/a) ::