Improve mouse support for menu and toggle.

This commit is contained in:
ArthurSonzogni
2021-04-24 18:16:13 +02:00
parent 890a41a64c
commit 8037a5fa5f
14 changed files with 124 additions and 36 deletions

View File

@@ -36,6 +36,7 @@ struct Event {
static Event MouseMiddleDown(std::string, int x, int y);
static Event MouseRightMove(std::string, int x, int y);
static Event MouseRightDown(std::string, int x, int y);
static Event CursorReporting(std::string, int x, int y);
// --- Arrow ---
static const Event ArrowLeft;
@@ -68,6 +69,7 @@ struct Event {
bool is_mouse_right_move() const { return type_ == Type::MouseRightMove; }
bool is_mouse_up() const { return type_ == Type::MouseUp; }
bool is_mouse_move() const { return type_ == Type::MouseMove; }
bool is_cursor_reporting() const { return type_ == Type::CursorReporting; }
int mouse_x() const { return mouse_.x; }
int mouse_y() const { return mouse_.y; }
@@ -90,6 +92,7 @@ struct Event {
MouseMiddleMove,
MouseRightDown,
MouseRightMove,
CursorReporting,
};
struct Mouse {