Skip to content

APointerIndex#

Wrapper class that stores either mouse button index or finger index.

Header:#include <AUI/Event/APointerIndex.h>
CMake:aui_link(my_target PUBLIC aui::views)

Examples#

examples/ui/embedded_sdl/src/main.cpp

SDL3 - This code demonstrates how to integrate the AUI Framework with SDL3 to create a window with OpenGL rendering.

}
/// [sdlToAInput]

/// [sdlToAPointer]
static auto sdlToAPointer(Uint8 button) -> APointerIndex {
    switch (button) {
        case SDL_BUTTON_LEFT:
            return APointerIndex::button(AInput::LBUTTON);
        case SDL_BUTTON_MIDDLE:
            return APointerIndex::button(AInput::CBUTTON);

Public Methods#

button#


AOptional<AInput::Key> APointerIndex::button()
Returns
(mouse) button, if it is.

Examples:

examples/ui/embedded_sdl/src/main.cpp

SDL3 - This code demonstrates how to integrate the AUI Framework with SDL3 to create a window with OpenGL rendering.

}
/// [sdlToAInput]

/// [sdlToAPointer]
static auto sdlToAPointer(Uint8 button) -> APointerIndex {
    switch (button) {
        case SDL_BUTTON_LEFT:
            return APointerIndex::button(AInput::LBUTTON);
        case SDL_BUTTON_MIDDLE:
            return APointerIndex::button(AInput::CBUTTON);

finger#


AOptional<int> APointerIndex::finger()
Returns
finger index, if it is.

isButton#


bool APointerIndex::isButton()
Returns
true if (mouse) button.

isFinger#


bool APointerIndex::isFinger()
Returns
true if finger index.