daisy::UiEventQueue¶
A queue that holds user input events in the UI system. More...
#include <UiEventQueue.h>
Public Functions¶
Name | |
---|---|
struct | attribute((packed) ) |
UiEventQueue() | |
~UiEventQueue() | |
void | AddButtonPressed(uint16_t buttonID, uint16_t numSuccessivePresses, bool isRetriggering =false) |
void | AddButtonReleased(uint16_t buttonID) |
void | AddEncoderTurned(uint16_t encoderID, int16_t increments, uint16_t stepsPerRev) |
void | AddEncoderActivityChanged(uint16_t encoderId, bool isActive) |
void | AddPotMoved(uint16_t potId, float newPosition) |
void | AddPotActivityChanged(uint16_t potId, bool isActive) |
Event | GetAndRemoveNextEvent() |
bool | IsQueueEmpty() |
Public Attributes¶
Name | |
---|---|
constexpr uint16_t | invalidButtonId |
constexpr uint16_t | invalidEncoderId |
constexpr uint16_t | invalidPotId |
Detailed Description¶
A queue that holds user input events in the UI system.
Author: jelliesen
A queue that holds user interface events such as button presses or encoder turns. The queue can be filled from hardware drivers and read from a UI object. Access to the queue is protected by a ScopedIrqBlocker - that means it's safe to add events from interrupt handlers.
Public Functions Documentation¶
function attribute¶
An event in the queue
The type of event
An invalid event. Returned to indicate that no events are left in the queue.
A button was pressed.
A button was released.
An encoder was turned.
The user has started or stopped turning an encoder.
A potentiometer was moved.
The user has started or stopped moving a potentiometer.
Used to indicate if a control is currently being used.
The control is not in use at the moment.
The control is actively used at the moment.
The type of event that this Event object represents.
The unique ID of the button that was pressed.
The number of successive button presses (e.g. double click).
True if the event was generated because a button was retriggered automatically while being held down.
The unique ID of the button that was released.
The unique ID of the encoder that was turned.
The number of increments detected.
The total number of increments per revolution.
The unique ID of the encoder that is affected.
The new activity type.
The unique ID of the pot that was moved.
The new position of the pot.
The unique ID of the pot that is affected.
The new activity type.
function UiEventQueue¶
function ~UiEventQueue¶
function AddButtonPressed¶
inline void AddButtonPressed(
uint16_t buttonID,
uint16_t numSuccessivePresses,
bool isRetriggering =false
)
Adds a Event::EventType::buttonPressed event to the queue.
function AddButtonReleased¶
Adds a Event::EventType::buttonReleased event to the queue.
function AddEncoderTurned¶
Adds a Event::EventType::encoderTurned event to the queue.
function AddEncoderActivityChanged¶
Adds a Event::EventType::encoderActivityChanged event to the queue.
function AddPotMoved¶
Adds a Event::EventType::potMoved event to the queue.
function AddPotActivityChanged¶
Adds a Event::EventType::potActivityChanged event to the queue.
function GetAndRemoveNextEvent¶
Removes and returns an event from the queue.
function IsQueueEmpty¶
Returns true, if the queue is empty.
Public Attributes Documentation¶
variable invalidButtonId¶
A button ID used to indicate an invalid or non existing button.
variable invalidEncoderId¶
An encoder ID used to indicate an invalid or non existing encoder.
variable invalidPotId¶
A potentiometer ID used to indicate an invalid or non existing potentiometer.
Updated on 2024-01-03 at 19:41:01 +0000