Skip to content

Engine → Platform

mouse_button.h

Mouse buttons: GLFW_MOUSE_BUTTON_* numbering, eight buttons.

Enumerations

mouse_button

enum class mouse_button : u8 {
    LEFT = 0,
    RIGHT = 1,
    MIDDLE = 2,
    BUTTON_4,
    BUTTON_5,
    BUTTON_6,
    BUTTON_7,
    BUTTON_8,
    COUNT
};

Constants

Name Type Value Description
MOUSE_BUTTON_COUNT inline constexpr u32 8

Functions

Public

is_valid_mouse_button

[[nodiscard]] constexpr bool is_valid_mouse_button(
    mouse_button button) noexcept;

True when the value names one of the eight buttons.

parse_mouse_button

[[nodiscard]] CONJURE_API std::optional<mouse_button> parse_mouse_button(
    std::string_view name) noexcept;

Parses an enumerator name case-insensitively; nullopt for anything else.

to_string

[[nodiscard]] CONJURE_API std::string_view to_string(
    mouse_button button) noexcept;

The enumerator name ("MIDDLE"), or "" for unknown values.