Terminal++ 3.1.0.4
A C++ library for interacting with ANSI terminal windows
Loading...
Searching...
No Matches
mouse.hpp
1#pragma once
2
3#include "terminalpp/point.hpp"
4
5#include <iosfwd>
6
7namespace terminalpp::mouse {
8
9enum class event_type : byte
10{
11 left_button_down,
12 middle_button_down,
13 right_button_down,
14 button_up,
15 no_button_change,
16 scrollwheel_up,
17 scrollwheel_down,
18};
19
20//* =========================================================================
22//* =========================================================================
23struct TERMINALPP_EXPORT event
24{
25 //* =====================================================================
27 //* =====================================================================
28 event_type action_ = event_type::no_button_change;
29
30 //* =====================================================================
32 //* =====================================================================
34
35 //* =====================================================================
37 //* =====================================================================
38 [[nodiscard]] constexpr friend auto operator<=>(
39 event const &lhs, event const &rhs) noexcept = default;
40};
41
42//* =========================================================================
44//* =========================================================================
45TERMINALPP_EXPORT
46std::ostream &operator<<(std::ostream &out, event const &ev);
47
48} // namespace terminalpp::mouse
A structure that encapsulates a mouse event.
Definition mouse.hpp:24
point position_
The position of the mouse in this event.
Definition mouse.hpp:33
constexpr friend auto operator<=>(event const &lhs, event const &rhs) noexcept=default
Relational operators for events.
A class that represents a position in space.
Definition point.hpp:17