CGPdocs

input_devices

State of the mouse, the keyboard and the time step, updated by the application.

module 15_input_devicessource: input_devices.hpp
The mouse position is stored in relative coordinates, from (-1,-1) at the bottom left to (1,1) at the top right; a mouse event updates inputs, is dropped if the cursor is over the GUI, and otherwise calls the callback of the scene.
The mouse position is stored in relative coordinates, from (-1,-1) at the bottom left to (1,1) at the top right; a mouse event updates inputs, is dropped if the cursor is over the GUI, and otherwise calls the callback of the scene. Tap to enlarge.

Fields and methods

Members of the struct input_devices. Most of what you do with a CGP type goes through the free functions listed below.

Fields

inputs_keyboard_parameters keyboardCurrent keyboard state (Shift, Ctrl, arrows, pressed keys and last key action).
inputs_mouse_parameters mouseCurrent mouse state (current and previous cursor positions in relative coordinates [-1,1], clicked buttons, scroll, whether the cursor is on the GUI).
float time_interval = 0Time in seconds elapsed since the previous frame, set by the application at each frame (0 before the first frame).

Functions taking a input_devices

None.

Functions returning a input_devices

None.

Operators

None.

CGP - Computer Graphics Programming.