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

@@ -107,10 +107,19 @@ Event Event::MouseMiddleDown(std::string input, int x, int y) {
return event;
}
Event Event::CursorReporting(std::string input, int x, int y) {
Event event;
event.input_ = std::move(input);
event.type_ = Type::CursorReporting;
event.mouse_ = {x, y};
return event;
}
bool Event::is_mouse() const {
switch (type_) {
case Type::Unknown:
case Type::Character:
case Type::CursorReporting:
return false;
case Type::MouseMove:
case Type::MouseUp: