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 gadget::DeviceInterface. They include the following:

  • gadget::PositionInterface (for trackers and other positional devices)

  • gadget::DigitalInterface (for buttons and other on/off devices)

  • gadget::AnalogInterface (for potentiometers and other multi-range data devices)

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