FTXUI
6.1.9
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 "
ftxui/util/export.hpp
"
8
9
namespace
ftxui
{
10
11
/// @brief A mouse event. It contains the coordinate of the mouse, the button
12
/// pressed and the modifier (shift, ctrl, meta).
13
/// @ingroup component
14
struct
FTXUI_EXPORT(COMPONENT) Mouse {
15
enum
Button {
16
Left
= 0,
17
Middle = 1,
18
Right
= 2,
19
None = 3,
20
WheelUp = 4,
21
WheelDown = 5,
22
WheelLeft = 6,
/// Supported terminal only.
23
WheelRight = 7,
/// Supported terminal only.
24
};
25
26
enum
Motion {
27
Released = 0,
28
Pressed = 1,
29
Moved = 2,
30
};
31
32
// Button
33
Button button = Button::None;
34
35
// Motion
36
Motion motion = Motion::Pressed;
37
38
// Modifiers:
39
bool
shift =
false
;
40
bool
meta =
false
;
41
bool
control =
false
;
42
43
// Coordinates:
44
int
x = 0;
45
int
y
= 0;
46
};
47
48
}
// namespace ftxui
49
50
#endif
/* end of include guard: FTXUI_COMPONENT_MOUSE_HPP */
export.hpp
ftxui::Direction::Right
@ Right
ftxui::Direction::Left
@ Left
ftxui
The FTXUI ftxui:: namespace.
Definition
animation.hpp:11
ftxui::y
int y
Definition
elements.hpp:126