|
Kanzi Graphics Engine
|
Input device handling. More...
Data Structures | |
| struct | KzsEventQueueIterator |
| Iterator for event queues. More... | |
Macros | |
| #define | KZS_POINTING_DEVICE_BUTTON_PRIMARY |
| Primary pointer button, e.g. More... | |
| #define | KZS_POINTING_DEVICE_BUTTON_SECONDARY |
| Secondary pointer button, e.g. More... | |
| #define | KZS_POINTING_DEVICE_BUTTON_TERTIARY |
| Tertiary pointer button, e.g. More... | |
| #define | KZS_POINTING_DEVICE_BUTTON_ROLL_UP |
| Roll up pointer button. More... | |
| #define | KZS_POINTING_DEVICE_BUTTON_ROLL_DOWN |
| Roll down pointer button. More... | |
| #define | kzsEventQueueIteratorIterate(it) |
| Iterate an event queue iterator. More... | |
| #define | kzsEventQueueIteratorGetValue(it) |
| Get the current value of an event queue iterator. More... | |
Typedefs | |
| typedef kzsError(* | KzsEventHandleFunction )(const struct KzsEventQueue *queue, void *userData) |
| Callback function type for event handling. More... | |
Functions | |
| kzsError | kzsEventQueueCreate (struct KzsEventQueue **queue_out) |
| Creates a new event queue. More... | |
| void | kzsEventQueueDelete (struct KzsEventQueue *queue) |
| Frees memory allocated for a input event queue. More... | |
| struct KzsEventQueueIterator | kzsEventQueueGetIterator (const struct KzsEventQueue *queue) |
| Get an iterator over an event queue. More... | |
| kzBool | kzsEventQueueIteratorIterate_private (struct KzsEventQueueIterator *it) |
| Internal iteration. More... | |
| struct KzsEvent * | kzsEventQueueIteratorGetValue_private (const struct KzsEventQueueIterator *it) |
| Internal iteration get value. More... | |
| struct KzsEvent * | kzsEventQueueGetEvent (const struct KzsEventQueue *queue, kzUint index) |
| Get nth event from an event queue. More... | |
| kzUint | kzsEventQueueGetEventCount (const struct KzsEventQueue *queue) |
| Get the number of events in an event queue. More... | |
| void | kzsEventQueueClear (struct KzsEventQueue *queue) |
| Clear all events from an event queue. More... | |
| void | kzsEventQueueSwap (struct KzsEventQueue *queue1, struct KzsEventQueue *queue2) |
| Swap contents of two queues. More... | |
| void | kzsEventInvalidate (struct KzsEvent *event) |
| Renders an event idempotent. More... | |
| struct KzsEvent * | kzsEventQueueAddRawEvent (struct KzsEventQueue *queue, const struct KzsEvent *event) |
| Adds a new event into the queue. More... | |
| struct KzsEvent * | kzsEventQueueAddKeyEvent (struct KzsEventQueue *queue, kzUint button, enum KzsInputKeyDeviceState state) |
| Adds a new key event into the queue with input values. More... | |
| struct KzsEvent * | kzsEventQueueAddPointerEvent (struct KzsEventQueue *queue, kzInt x, kzInt y, kzU32 buttons, enum KzsInputPointingDeviceState state) |
| Adds a new pointer event into the queue with input values. More... | |
| struct KzsEvent * | kzsEventQueueAddTouchEvent (struct KzsEventQueue *queue, kzUint numCursors) |
| Adds a new touch event. More... | |
| struct KzsEvent * | kzsEventQueueAddTouchEventWithState (struct KzsEventQueue *queue, kzUint numCursors, enum KzsInputTouchState state) |
| As add touch event, but with a state already set now. More... | |
| struct KzsEvent * | kzsEventQueueAddSimpleWindowEvent (struct KzsEventQueue *queue, enum KzsEventType type, struct KzsWindow *window) |
| Adds a new window event into the queue. More... | |
| struct KzsEvent * | kzsEventQueueAddWindowResizeEvent (struct KzsEventQueue *queue, struct KzsWindow *window, kzUint width, kzUint height) |
| Adds a new window resize event into the queue. More... | |
| struct KzsEvent * | kzsEventQueueAddWindowOrientationChangeEvent (struct KzsEventQueue *queue, struct KzsWindow *window, enum KzsWindowOrientation orientation) |
| Adds a new orientation change event into the queue. More... | |
| struct KzsEvent * | kzsEventQueueAddApplicationPausedEvent (struct KzsEventQueue *queue) |
| Adds a new application paused event. More... | |
| struct KzsEvent * | kzsEventQueueAddApplicationSuspendedEvent (struct KzsEventQueue *queue) |
| Adds a new application suspended event. More... | |
| struct KzsEvent * | kzsEventQueueAddApplicationResumedEvent (struct KzsEventQueue *queue) |
| Adds a new application resumed event. More... | |
| struct KzsEvent * | kzsEventQueueAddToggleHUDDebugEvent (struct KzsEventQueue *queue) |
| Adds a new toggle HUD debug event into the queue. More... | |
| struct KzsEvent * | kzsEventQueueAddSetHUDDebugEvent (struct KzsEventQueue *queue, kzInt onoff) |
| Adds a new set HUD debug event into the queue. More... | |
| struct KzsInputEventPointer * | kzsInputEventGetPointingDeviceData (const struct KzsEvent *event) |
| Get the pointer event from an input event. More... | |
| struct KzsInputEventKey * | kzsInputEventGetKeyDeviceData (const struct KzsEvent *event) |
| Get key event from an input event. More... | |
| struct KzsInputEventTouch * | kzsInputEventGetTouchData (const struct KzsEvent *event) |
| Get touch event from an input event. More... | |
| enum KzsEventType | kzsEventGetType (const struct KzsEvent *event) |
| Get the event type. More... | |
| kzUint | kzsInputCursorGetId (const struct KzsInputCursor *inputdata) |
| Get the identifier of the touch cursor. More... | |
| kzFloat | kzsInputCursorGetPressure (const struct KzsInputCursor *inputData) |
| Gets the pressure of the touch cursor. More... | |
| kzFloat | kzsInputCursorGetRadius (const struct KzsInputCursor *inputData) |
| Gets the radius of the touch cursor. More... | |
| kzFloat | kzsInputCursorGetX (const struct KzsInputCursor *inputData) |
| Get the x coordinate of touch cursor. More... | |
| kzFloat | kzsInputCursorGetY (const struct KzsInputCursor *inputData) |
| Get the y coordinate of touch cursor. More... | |
| enum KzsInputCursorState | kzsInputCursorGetState (const struct KzsInputCursor *inputdata) |
| Get the state of the touch cursor. More... | |
| kzUint | kzsInputEventKeyGetButtonRaw (const struct KzsInputEventKey *inputData) |
| Gets the raw button code of the key device. More... | |
| enum KzsInputKey | kzsInputEventKeyGetButton (const struct KzsInputEventKey *inputData) |
| Gets the translated button of the key device. More... | |
| enum KzsInputKeyDeviceState | kzsInputEventKeyGetState (const struct KzsInputEventKey *inputData) |
| Gets the state of the key device. More... | |
| kzU32 | kzsInputEventPointerGetButtons (const struct KzsInputEventPointer *inputData) |
| Gets the bitfield of the buttons of the active pointing device. More... | |
| enum KzsInputPointingDeviceState | kzsInputEventPointerGetState (const struct KzsInputEventPointer *inputData) |
| Gets the state of the active pointing device. More... | |
| kzInt | kzsInputEventPointerGetX (const struct KzsInputEventPointer *inputData) |
| Gets the x coordinate of the active pointing device. More... | |
| kzInt | kzsInputEventPointerGetY (const struct KzsInputEventPointer *inputData) |
| Gets the y coordinate of the active pointing device. More... | |
| struct KzsInputCursor * | kzsInputEventTouchGetCursor (const struct KzsInputEventTouch *inputData, kzUint cursorIdx) |
| Get the nth cursor form a touch event. More... | |
| kzUint | kzsInputEventTouchGetCursorCount (const struct KzsInputEventTouch *inputData) |
| Get the number of cursors in this event. More... | |
| enum KzsInputTouchState | kzsInputEventTouchGetState (const struct KzsInputEventTouch *inputData) |
| Get the touch state. More... | |
| kzBool | kzsInputEventTouchSetCursor (struct KzsEventQueue *queue, struct KzsEvent *event, kzUint cursorIndex, kzUint cursorId, kzFloat x, kzFloat y, kzFloat pressure, kzFloat radius, enum KzsInputCursorState state) |
| Add a cursor to a touch event. More... | |
| void | kzsInputEventTouchSetState (struct KzsEvent *event, enum KzsInputTouchState state) |
| Set the state of touch event. More... | |
| struct KzsWindow * | kzsWindowEventGetTarget (const struct KzsEvent *event) |
| Get the target window of the event. More... | |
| kzUint | kzsWindowEventResizeGetWidth (const struct KzsEvent *event) |
| Get the window width of a resize event. More... | |
| kzUint | kzsWindowEventResizeGetHeight (const struct KzsEvent *event) |
| Get the window height of a resize event. More... | |
| enum KzsWindowOrientation | kzsWindowEventOrientationChangeGetOrientation (const struct KzsEvent *event) |
| Get the window orientation of a orientation change event. More... | |
| enum KzsInputKey | kzsInputNativeGetTranslatedKey (kzUint button) |
| Returns the translated key. More... | |
| struct KzsDebugEventSetHUD * | kzsEventGetSetHUDData (const struct KzsEvent *event) |
| Get set HUD event data from an event. More... | |
| kzInt | kzsSetHUDDebugEventGetOnOff (const struct KzsDebugEventSetHUD *inputData) |
| Returns set HUD debug event parameter. More... | |
Input device handling.
Keyboards, mice, touch screens, joysticks and similar devices.
Copyright 2008-2019 by Rightware. All rights reserved.
| #define KZS_POINTING_DEVICE_BUTTON_PRIMARY |
Primary pointer button, e.g.
usually mouse left on Windows.
| #define KZS_POINTING_DEVICE_BUTTON_SECONDARY |
Secondary pointer button, e.g.
usually mouse right on Windows.
| #define KZS_POINTING_DEVICE_BUTTON_TERTIARY |
Tertiary pointer button, e.g.
usually mouse middle on Windows.
| #define KZS_POINTING_DEVICE_BUTTON_ROLL_UP |
Roll up pointer button.
| #define KZS_POINTING_DEVICE_BUTTON_ROLL_DOWN |
Roll down pointer button.
| #define kzsEventQueueIteratorIterate | ( | it) |
Iterate an event queue iterator.
Return true if this value is still valid.
| #define kzsEventQueueIteratorGetValue | ( | it) |
Get the current value of an event queue iterator.
Callback function type for event handling.
| enum KzsWindowOrientation |
| enum KzsEventType |
Enumeration for different types of events.
| enum KzsInputTranslation |
Enumeration to select translation of events.
Enumeration for different states for a pointing device.
| enum KzsInputCursorState |
| enum KzsInputTouchState |
| enum KzsInputOrientation |
| enum KzsInputKey |
Platform independent key enumeration.
| kzsError kzsEventQueueCreate | ( | struct KzsEventQueue ** | queue_out) |
Creates a new event queue.
| void kzsEventQueueDelete | ( | struct KzsEventQueue * | queue) |
Frees memory allocated for a input event queue.
| struct KzsEventQueueIterator kzsEventQueueGetIterator | ( | const struct KzsEventQueue * | queue) |
Get an iterator over an event queue.
| kzBool kzsEventQueueIteratorIterate_private | ( | struct KzsEventQueueIterator * | it) |
Internal iteration.
| struct KzsEvent* kzsEventQueueIteratorGetValue_private | ( | const struct KzsEventQueueIterator * | it) |
Internal iteration get value.
| struct KzsEvent* kzsEventQueueGetEvent | ( | const struct KzsEventQueue * | queue, |
| kzUint | index | ||
| ) |
Get nth event from an event queue.
| kzUint kzsEventQueueGetEventCount | ( | const struct KzsEventQueue * | queue) |
Get the number of events in an event queue.
| void kzsEventQueueClear | ( | struct KzsEventQueue * | queue) |
Clear all events from an event queue.
| void kzsEventQueueSwap | ( | struct KzsEventQueue * | queue1, |
| struct KzsEventQueue * | queue2 | ||
| ) |
Swap contents of two queues.
| void kzsEventInvalidate | ( | struct KzsEvent * | event) |
Renders an event idempotent.
| struct KzsEvent* kzsEventQueueAddRawEvent | ( | struct KzsEventQueue * | queue, |
| const struct KzsEvent * | event | ||
| ) |
Adds a new event into the queue.
| struct KzsEvent* kzsEventQueueAddKeyEvent | ( | struct KzsEventQueue * | queue, |
| kzUint | button, | ||
| enum KzsInputKeyDeviceState | state | ||
| ) |
Adds a new key event into the queue with input values.
| struct KzsEvent* kzsEventQueueAddPointerEvent | ( | struct KzsEventQueue * | queue, |
| kzInt | x, | ||
| kzInt | y, | ||
| kzU32 | buttons, | ||
| enum KzsInputPointingDeviceState | state | ||
| ) |
Adds a new pointer event into the queue with input values.
If translating to touch events, add a touch event with one cursor instead.
| struct KzsEvent* kzsEventQueueAddTouchEvent | ( | struct KzsEventQueue * | queue, |
| kzUint | numCursors | ||
| ) |
Adds a new touch event.
The touch event generated will have a specified number of cursors. The cursors must be filled separately to the event structure returned from this function.
| struct KzsEvent* kzsEventQueueAddTouchEventWithState | ( | struct KzsEventQueue * | queue, |
| kzUint | numCursors, | ||
| enum KzsInputTouchState | state | ||
| ) |
As add touch event, but with a state already set now.
| struct KzsEvent* kzsEventQueueAddSimpleWindowEvent | ( | struct KzsEventQueue * | queue, |
| enum KzsEventType | type, | ||
| struct KzsWindow * | window | ||
| ) |
Adds a new window event into the queue.
| struct KzsEvent* kzsEventQueueAddWindowResizeEvent | ( | struct KzsEventQueue * | queue, |
| struct KzsWindow * | window, | ||
| kzUint | width, | ||
| kzUint | height | ||
| ) |
Adds a new window resize event into the queue.
| struct KzsEvent* kzsEventQueueAddWindowOrientationChangeEvent | ( | struct KzsEventQueue * | queue, |
| struct KzsWindow * | window, | ||
| enum KzsWindowOrientation | orientation | ||
| ) |
Adds a new orientation change event into the queue.
| struct KzsEvent* kzsEventQueueAddApplicationPausedEvent | ( | struct KzsEventQueue * | queue) |
Adds a new application paused event.
| struct KzsEvent* kzsEventQueueAddApplicationSuspendedEvent | ( | struct KzsEventQueue * | queue) |
Adds a new application suspended event.
| struct KzsEvent* kzsEventQueueAddApplicationResumedEvent | ( | struct KzsEventQueue * | queue) |
Adds a new application resumed event.
| struct KzsEvent* kzsEventQueueAddToggleHUDDebugEvent | ( | struct KzsEventQueue * | queue) |
Adds a new toggle HUD debug event into the queue.
| struct KzsEvent* kzsEventQueueAddSetHUDDebugEvent | ( | struct KzsEventQueue * | queue, |
| kzInt | onoff | ||
| ) |
Adds a new set HUD debug event into the queue.
| struct KzsInputEventPointer* kzsInputEventGetPointingDeviceData | ( | const struct KzsEvent * | event) |
Get the pointer event from an input event.
| struct KzsInputEventKey* kzsInputEventGetKeyDeviceData | ( | const struct KzsEvent * | event) |
Get key event from an input event.
| struct KzsInputEventTouch* kzsInputEventGetTouchData | ( | const struct KzsEvent * | event) |
Get touch event from an input event.
| enum KzsEventType kzsEventGetType | ( | const struct KzsEvent * | event) |
Get the event type.
| kzUint kzsInputCursorGetId | ( | const struct KzsInputCursor * | inputdata) |
Get the identifier of the touch cursor.
| kzFloat kzsInputCursorGetPressure | ( | const struct KzsInputCursor * | inputData) |
Gets the pressure of the touch cursor.
| kzFloat kzsInputCursorGetRadius | ( | const struct KzsInputCursor * | inputData) |
Gets the radius of the touch cursor.
| kzFloat kzsInputCursorGetX | ( | const struct KzsInputCursor * | inputData) |
Get the x coordinate of touch cursor.
| kzFloat kzsInputCursorGetY | ( | const struct KzsInputCursor * | inputData) |
Get the y coordinate of touch cursor.
| enum KzsInputCursorState kzsInputCursorGetState | ( | const struct KzsInputCursor * | inputdata) |
Get the state of the touch cursor.
| kzUint kzsInputEventKeyGetButtonRaw | ( | const struct KzsInputEventKey * | inputData) |
Gets the raw button code of the key device.
| enum KzsInputKey kzsInputEventKeyGetButton | ( | const struct KzsInputEventKey * | inputData) |
Gets the translated button of the key device.
| enum KzsInputKeyDeviceState kzsInputEventKeyGetState | ( | const struct KzsInputEventKey * | inputData) |
Gets the state of the key device.
| kzU32 kzsInputEventPointerGetButtons | ( | const struct KzsInputEventPointer * | inputData) |
Gets the bitfield of the buttons of the active pointing device.
| inputData | Input data pointer. |
| enum KzsInputPointingDeviceState kzsInputEventPointerGetState | ( | const struct KzsInputEventPointer * | inputData) |
Gets the state of the active pointing device.
| kzInt kzsInputEventPointerGetX | ( | const struct KzsInputEventPointer * | inputData) |
Gets the x coordinate of the active pointing device.
| kzInt kzsInputEventPointerGetY | ( | const struct KzsInputEventPointer * | inputData) |
Gets the y coordinate of the active pointing device.
| struct KzsInputCursor* kzsInputEventTouchGetCursor | ( | const struct KzsInputEventTouch * | inputData, |
| kzUint | cursorIdx | ||
| ) |
Get the nth cursor form a touch event.
| kzUint kzsInputEventTouchGetCursorCount | ( | const struct KzsInputEventTouch * | inputData) |
Get the number of cursors in this event.
| enum KzsInputTouchState kzsInputEventTouchGetState | ( | const struct KzsInputEventTouch * | inputData) |
Get the touch state.
Note that touch state goes DOWN when the first finger touches the screen and UP when the last finger leaves. Everything in-between is drag.
| kzBool kzsInputEventTouchSetCursor | ( | struct KzsEventQueue * | queue, |
| struct KzsEvent * | event, | ||
| kzUint | cursorIndex, | ||
| kzUint | cursorId, | ||
| kzFloat | x, | ||
| kzFloat | y, | ||
| kzFloat | pressure, | ||
| kzFloat | radius, | ||
| enum KzsInputCursorState | state | ||
| ) |
Add a cursor to a touch event.
The queue is needed for potential mirroring of the event.
Returns true if there was space for the cursor, false otherwise.
If translating pointer events, add a pointer event instead and mark the touch event as unusable.
If the event is not a touch event, do nothing unless translating.
| void kzsInputEventTouchSetState | ( | struct KzsEvent * | event, |
| enum KzsInputTouchState | state | ||
| ) |
Set the state of touch event.
This function takes a generic event structure for consistency.
If the event is not a touch event, do nothing.
| struct KzsWindow* kzsWindowEventGetTarget | ( | const struct KzsEvent * | event) |
Get the target window of the event.
| kzUint kzsWindowEventResizeGetWidth | ( | const struct KzsEvent * | event) |
Get the window width of a resize event.
| kzUint kzsWindowEventResizeGetHeight | ( | const struct KzsEvent * | event) |
Get the window height of a resize event.
| enum KzsWindowOrientation kzsWindowEventOrientationChangeGetOrientation | ( | const struct KzsEvent * | event) |
Get the window orientation of a orientation change event.
| enum KzsInputKey kzsInputNativeGetTranslatedKey | ( | kzUint | button) |
Returns the translated key.
| struct KzsDebugEventSetHUD* kzsEventGetSetHUDData | ( | const struct KzsEvent * | event) |
Get set HUD event data from an event.
| kzInt kzsSetHUDDebugEventGetOnOff | ( | const struct KzsDebugEventSetHUD * | inputData) |
Returns set HUD debug event parameter.