FTXUI 7.0.0
C++ functional terminal UI.
Loading...
Searching...
No Matches
mouse.hpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#ifndef FTXUI_COMPONENT_MOUSE_HPP
5#define FTXUI_COMPONENT_MOUSE_HPP
6
7#include <cstdint>
8
10
11namespace ftxui {
12
13/// @brief A mouse event. It contains the coordinate of the mouse, the button
14/// pressed and the modifier (shift, ctrl, meta).
15/// @ingroup component
16struct FTXUI_EXPORT(COMPONENT) Mouse {
17 enum Button : uint8_t {
18 Left = 0,
19 Middle = 1,
20 Right = 2,
21 None = 3,
22 WheelUp = 4,
23 WheelDown = 5,
24 WheelLeft = 6, /// Supported terminal only.
25 WheelRight = 7, /// Supported terminal only.
26 };
27
28 enum Motion : uint8_t {
29 Released = 0,
30 Pressed = 1,
31 Moved = 2,
32 };
33
34 // Button
35 Button button = Button::None;
36
37 // Motion
38 Motion motion = Motion::Pressed;
39
40 // Modifiers:
41 bool shift = false;
42 bool meta = false;
43 bool control = false;
44
45 // Coordinates:
46 int x = 0;
47 int y = 0;
48};
49
50} // namespace ftxui
51
52#endif /* end of include guard: FTXUI_COMPONENT_MOUSE_HPP */
The FTXUI ftxui:: namespace.
Definition animation.hpp:11
int y
Definition elements.hpp:127