Defines input events and associated data types.
Identifies possible input subsystem types. The types of events that each device
type produces correspond to
Input from a gesture-detection mechanism. Examples include Kinect, Wiimotes, etc...
Input from a gamepad, following the layout provided in the W3C Web Gamepad API. [ https://www.w3.org/TR/gamepad/ ]
Keyboard input from a traditional keyboard or game controller chatpad.
Input from a traditional mouse.
Input from a TV remote-control-style device.
Input from a single- or multi-touchscreen.
Input from a touchpad that is not masquerading as a mouse.
Keyboard input from an on screen keyboard.
The action that an input event represents.
Device Movement. In the case of
Mouse, and perhaps
Gesture, the movement tracks an absolute cursor position. In the case of
TouchPad, only relative movements are provided.
Key or button press activation. This could be a key on a keyboard, a button on a mouse or game controller, a push from a touch screen, or a gesture. An
Unpressevent is subsequently delivered when the
Pressevent terminates, such as when the key/button/finger is raised. Injecting repeat presses is up to the client.
Key or button deactivation. The counterpart to the
Pressevent, this event is sent when the key or button being pressed is released.
Wheel movement. Provides relative movements of the
Event data for
The time that should be reported for this event. This is intended to facilitate calculation of time-sensitive information (e.g. velocity for kSbInputEventTypeMove). This may be set to 0 to have the relevant systems automatically set the timestamp. However, this may happen at a later time, so the relative time between events may not be preserved.
The window in which the input was generated.
The type of input event that this represents.
The type of device that generated this input event.
An identifier that is unique among all connected devices.
An identifier that indicates which keyboard key or mouse button was involved in this event, if any. All known keys for all devices are mapped to a single ID space, defined by the
The character that corresponds to the key. For an external keyboard, this character also depends on the keyboard language. The value is
0if there is no corresponding character.
The location of the specified key, in cases where there are multiple instances of the button on the keyboard. For example, some keyboards have more than one "shift" key.
unsigned int key_modifiers
Key modifiers (e.g.
Shift) held down during this input event.
The (x, y) coordinates of the persistent cursor controlled by this device. The value is
0if this data is not applicable. For events with type kSbInputEventTypeMove and device_type kSbInputDeviceTypeGamepad, this field is interpreted as a stick position with the range [-1, 1], with positive values for the down and right direction.
The relative motion vector of this input. The value is
0if this data is not applicable.
The normalized pressure of the pointer input in the range of [0,1], where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively. Use NaN for devices that do not report pressure. This value is used for input events with device type mouse or touch screen.
The (width, height) of the contact geometry of the pointer. This defines the size of the area under the pointer position. If (NaN, NaN) is specified, the value (0,0) will be used. This value is used for input events with device type mouse or touch screen.
The (x, y) angle in degrees, in the range of [-90, 90] of the pointer, relative to the z axis. Positive values are for tilt to the right (x), and towards the user (y). Use (NaN, NaN) for devices that do not report tilt. This value is used for input events with device type mouse or touch screen.
const char * input_text
The text to input for events of type
Set to true if the input event is part of a composition event.
A 2-dimensional vector used to represent points and motion vectors.