AI-generated Key Takeaways
-
Defines input events and their associated data types, including device types and event types.
-
SbInputDeviceTypeenum identifies input sources like keyboard, mouse, touchscreen, gamepad, etc., each producing specific event types. -
SbInputEventTypeenum defines actions like move, press, unpress, wheel, and input, detailing the nature of the input event. -
SbInputDatastruct encapsulates comprehensive event data including device type, key codes, modifiers, position, pressure, and more. -
SbInputVectorstruct represents 2D vectors used for positions, motion, and other input parameters like size and tilt.
Defines input events and associated data types.
Enums
SbInputDeviceType
Identifies possible input subsystem types. The types of events that each device
type produces correspond to SbInputEventType values.
Values
kSbInputDeviceTypeGestureInput from a gesture-detection mechanism. Examples include Kinect, Wiimotes, etc...
Produces
Move,PressandUnpressevents.kSbInputDeviceTypeGamepadInput from a gamepad, following the layout provided in the W3C Web Gamepad API. [ https://www.w3.org/TR/gamepad/ ]
Produces
Move,PressandUnpressevents.kSbInputDeviceTypeKeyboardKeyboard input from a traditional keyboard or game controller chatpad.
Produces
PressandUnpressevents.kSbInputDeviceTypeMouseInput from a traditional mouse.
Produces
Move,Press, andUnpressevents.kSbInputDeviceTypeRemoteInput from a TV remote-control-style device.
Produces
PressandUnpressevents.kSbInputDeviceTypeTouchScreenInput from a single- or multi-touchscreen.
Produces
Move,Press, andUnpressevents.kSbInputDeviceTypeTouchPadInput from a touchpad that is not masquerading as a mouse.
Produces
Move,Press, andUnpressevents.kSbInputDeviceTypeOnScreenKeyboardKeyboard input from an on screen keyboard.
Produces
Inputevents.
SbInputEventType
The action that an input event represents.
Values
kSbInputEventTypeMoveDevice Movement. In the case of
Mouse, and perhapsGesture, the movement tracks an absolute cursor position. In the case ofTouchPad, only relative movements are provided.kSbInputEventTypePressKey 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 thePressevent terminates, such as when the key/button/finger is raised. Injecting repeat presses is up to the client.kSbInputEventTypeUnpressKey or button deactivation. The counterpart to the
Pressevent, this event is sent when the key or button being pressed is released.kSbInputEventTypeWheelWheel movement. Provides relative movements of the
Mousewheel.kSbInputEventTypeInput
Structs
SbInputData
Event data for kSbEventTypeInput events.
Members
SbWindow windowThe window in which the input was generated.
SbInputEventType typeThe type of input event that this represents.
SbInputDeviceType device_typeThe type of device that generated this input event.
int device_idAn identifier that is unique among all connected devices.
SbKey keyAn 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
SbKeyenum inkey.h.wchar_t characterThe 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.SbKeyLocation key_locationThe 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_modifiersKey modifiers (e.g.
Ctrl,Shift) held down during this input event.SbInputVector positionThe (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.SbInputVector deltaThe relative motion vector of this input. The value is
0if this data is not applicable.float pressureThe 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.
SbInputVector sizeThe (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.
SbInputVector tiltThe (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_textThe text to input for events of type
Input.bool is_composingSet to true if the input event is part of a composition event.
SbInputVector
A 2-dimensional vector used to represent points and motion vectors.
Members
float xfloat y