|
Muteki
EABI code execution on Besta® RTOS devices.
|
Low-level UI event handing API. More...
#include "../types/framework.h"Go to the source code of this file.
Data Structures | |
| struct | key_press_event_config_t |
| Configuration struct for key press event generator. More... | |
Enumerations | |
| enum | toggle_key_state_e { TOGGLE_KEY_INACTIVE = 0 , TOGGLE_KEY_ACTIVE , TOGGLE_KEY_TRIGGERED } |
| Toggle key states. More... | |
Functions | |
| void | GetSysKeyState (key_press_event_config_t *config) |
| Read current configuration of key event generator. | |
| void | SetSysKeyState (const key_press_event_config_t *config) |
| Configure key event generator. | |
| int | GetPenEvent (ui_event_sys_t *event) |
| Consume event from the system UI event queue (mostly for touch). | |
| int | CheckPenEvent (void) |
| Check whether or not there are any pending system UI events. | |
| void | ClearPenEvent (void) |
| Discard all unconsumed system UI events. | |
| int | PutSystemEvent (ui_event_sys_t *event) |
| Produce a system UI event. | |
| bool | GetEvent (ui_event_t *event) |
| Consume an event. | |
| bool | GetPendEvent (ui_event_t *event) |
| Consume an event from the main event queue. | |
| unsigned int | SetEventType (unsigned int mask) |
| Set the event type bit mask. | |
| unsigned int | GetEventType (void) |
| Get the current event type bit mask. | |
| bool | PutEvent (ui_event_t *event) |
| Produce an event in the main event queue. | |
| void | PutEventExt (int type, unsigned int value, void *user_data) |
| Produce an event in the main event queue (by values). | |
| bool | TestPendEvent (ui_event_t *event) |
| Peek pending events in the main event queue, and also special events. | |
| void | ClearPendEvent (void) |
| Empty all unconsumed events in the main event queue. | |
| void | ClearPenState (void) |
| Reset the touch state tracker only. | |
| void | ClearEvent (ui_event_t *event) |
| Invalidate an event struct. | |
| void | ClearAllEvents (void) |
| Discard unprocessed UI events. | |
| bool | TestKeyEvent (ui_event_t *event) |
| Peek pending events in the system event queue. | |
| unsigned short | SetShiftState (unsigned short new_state) |
| Manually set the state of the SHIFT toggle key. | |
| unsigned short | SetCapsState (unsigned short new_state) |
| Manually set the state of the CAPS toggle key. | |
| unsigned short | GetShiftState (void) |
| Get the state of the SHIFT toggle key. | |
| unsigned short | GetCapsState (void) |
| Get the state of the SHIFT toggle key. | |
| bool | SendMessage (ui_event_t *event) |
| Synchronously send an event to a recipient, bypassing the event queuing mechanism. | |
| bool | SendMessageExt (ui_component_t *recipient, int event_type, unsigned int value, void *user_data) |
| Synchronously send an event to a recipient (by values). | |
Low-level UI event handing API.
There are 2 event queues:
GetEvent() consolidates events from both event queues into a single handler.
As a part of inter-component communication, the event subsystem also includes a way to send an event directly to a UI component. See SendMessage() and SendMessageExt().
| enum toggle_key_state_e |
Toggle key states.
|
extern |
Check whether or not there are any pending system UI events.
| 0 | No event available, and touch is not active. |
| 1 | Some event is available, or touch is active. |
|
extern |
Discard unprocessed UI events.
This drains both the main and the system event queues, the UI_EVENT_TYPE_SPECIAL flag, and resets the touch state tracker.
|
extern |
Invalidate an event struct.
This function zeros out ui_event_t::event_type and ui_event_t::event_source.
| [in,out] | event | Pointer to a ui_event_t struct. |
|
extern |
Empty all unconsumed events in the main event queue.
|
extern |
Discard all unconsumed system UI events.
|
extern |
Reset the touch state tracker only.
|
extern |
Get the state of the SHIFT toggle key.
|
extern |
Consume an event.
This will try to consume the next event from firstly the main event queue, and when the main event queue is empty, the system event queue.
| [out] | event | Pointer to a ui_event_t struct. |
| true | Some events were consumed and returned. |
| false | No event was consumed and returned. |
|
extern |
Get the current event type bit mask.
|
extern |
Consume an event from the main event queue.
This pops an event from the main event queue only without blocking.
This is mostly used as a pass in GetEvent() internally.
| [out] | event | Event. |
| true | An event has been consumed. |
| false | No event has been consumed. |
|
extern |
Consume event from the system UI event queue (mostly for touch).
If touch is active, this will generate a touch hold event on the fly. Similarly, a touch release event will be generated if touch is not active. Due to this behavior, this function never blocks.
| [out] | event | A simplified event struct that contains only the fields related to input. |
| 0 | No event was consumed. |
| 1 | Event is consumed. |
|
extern |
Get the state of the SHIFT toggle key.
|
extern |
Read current configuration of key event generator.
| [out] | config | The configuration struct for holding the exported configuration. |
|
extern |
Produce an event in the main event queue.
| [in,out] | event | The event. |
| true | Successfully signaled the subscribers. |
| false | Attempt to produce an invalidated event, or failed to signal the subscribers. |
|
extern |
Produce an event in the main event queue (by values).
This zero-allocates a temporary event struct on the stack, sets the user-specified fields and then calls PutEvent() to produce an event.
| type | Event type. |
| value | Raw 32-bit event value. |
| user_data | User data pointer. |
|
extern |
Produce a system UI event.
| event | New system UI event. |
| true | Successfully signaled the subscribers. |
| false | Error occurred when signaling the subscribers. |
|
extern |
Synchronously send an event to a recipient, bypassing the event queuing mechanism.
| [in,out] | event | The event. Must contain a valid ui_event_t::recipient. |
|
extern |
Synchronously send an event to a recipient (by values).
This allocates a temporary event struct on the stack, sets the user-specified fields and then calls SendMessage() to send the generated event.
| [in,out] | recipient | The UI component receiving the event. |
| event_type | Event type. | |
| value | Raw 32-bit event value. | |
| [in,out] | user_data | User data pointer. |
|
extern |
Manually set the state of the CAPS toggle key.
| new_state | The new state. |
|
extern |
Set the event type bit mask.
The default is to allow all event types (0xffffffff). If the corresponding bit is 0, the event processing with GetEvent() will stall until the bit is set back to 1.
| mask | New event type bit mask of allowed event types. |
|
extern |
Manually set the state of the SHIFT toggle key.
| new_state | The new state. |
|
extern |
Configure key event generator.
| [in] | config | The configuration struct to be imported. |
|
extern |
Peek pending events in the system event queue.
| [out] | event | pointer to a ui_event_t struct. |
| true | Some events were processed. |
| false | No event was processed. |
|
extern |
Peek pending events in the main event queue, and also special events.
| [out] | event | pointer to a ui_event_t struct. |
| true | Some events need to be consumed. This may be a special event that has no data. In that case event.event_type is cleared. |
| false | No event needs to be consumed. |