Loading...
Searching...
No Matches
mouse.hpp
Go to the documentation of this file.
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#ifndef FTXUI_COMPONENT_MOUSE_HPP
#define FTXUI_COMPONENT_MOUSE_HPP
namespace ftxui {
/// @brief A mouse event. It contains the coordinate of the mouse, the button
/// pressed and the modifier (shift, ctrl, meta).
/// @ingroup component
struct Mouse {
enum Button {
Left = 0,
Middle = 1,
Right = 2,
None = 3,
WheelUp = 4,
WheelDown = 5,
WheelLeft = 6, /// Supported terminal only.
WheelRight = 7, /// Supported terminal only.
};
enum Motion {
Released = 0,
Pressed = 1,
Moved = 2,
};
// Button
Button button = Button::None;
// Motion
Motion motion = Motion::Pressed;
// Modifiers:
bool shift = false;
bool meta = false;
bool control = false;
// Coordinates:
int x = 0;
int y = 0;
};
} // namespace ftxui
#endif /* end of include guard: FTXUI_COMPONENT_MOUSE_HPP */
ftxui
Definition animation.hpp:10
ftxui::Mouse
A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift,...
Definition mouse.hpp:11
ftxui::Mouse::Button
Button
Definition mouse.hpp:12
ftxui::Mouse::WheelLeft
@ WheelLeft
Definition mouse.hpp:19
ftxui::Mouse::Middle
@ Middle
Definition mouse.hpp:14
ftxui::Mouse::Left
@ Left
Definition mouse.hpp:13
ftxui::Mouse::WheelUp
@ WheelUp
Definition mouse.hpp:17
ftxui::Mouse::None
@ None
Definition mouse.hpp:16
ftxui::Mouse::Right
@ Right
Definition mouse.hpp:15
ftxui::Mouse::WheelRight
@ WheelRight
Supported terminal only.
Definition mouse.hpp:20
ftxui::Mouse::WheelDown
@ WheelDown
Definition mouse.hpp:18
ftxui::Mouse::Motion
Motion
Definition mouse.hpp:23
ftxui::Mouse::Pressed
@ Pressed
Definition mouse.hpp:25
ftxui::Mouse::Moved
@ Moved
Definition mouse.hpp:26
ftxui::Mouse::Released
@ Released
Definition mouse.hpp:24
ftxui::Mouse::y
int y
Definition mouse.hpp:42
ftxui::Mouse::meta
bool meta
Definition mouse.hpp:37
ftxui::Mouse::x
int x
Definition mouse.hpp:41
ftxui::Mouse::button
Button button
Definition mouse.hpp:30
ftxui::Mouse::shift
bool shift
Definition mouse.hpp:36
ftxui::Mouse::control
bool control
Definition mouse.hpp:38
ftxui::Mouse::motion
Motion motion
Definition mouse.hpp:33