Getting Input from Devices

In GLUT

For keyboard input, the following functions are used:

  • glutKeyboardFunc(OnKeyboardDown)

  • glutKeyboardUpFunc(OnKeyboardUp)

  • glutSpecialFunc(OnSpecialKeyboardDown)

  • glutSpecialUpFunc(OnSpecialKeyboardUp)

For mouse input, the following functions are used:

  • glutMouseFunc(OnMouseButton)

  • glutMotionFunc(OnMousePosition)

  • glutPassiveMotionFunc(OnMousePosition)

In VR Juggler

To get device input, use the classes derived from vjDeviceInterface. They include the following:

  • vjPosInterface (for trackers and other positional devices)

  • vjDigitalInterface (for buttons and other on/off devices)

  • vjAnalogInterface (for potentiometers and other multi-range data devices)

For more information about the VR Juggler device interfaces, refer to Chapter 3. A tutorial on getting device input in VR Juggler applications can be found in the section called “Getting Input”.