From 44658873a311ad0356eaa321a04ee473538b9087 Mon Sep 17 00:00:00 2001 From: Shaohua Tong Date: Fri, 29 Nov 2019 14:48:31 +0100 Subject: [PATCH] fix flag_drag --- src/GUI_Window.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/GUI_Window.cpp b/src/GUI_Window.cpp index 9e931c3..82882f0 100644 --- a/src/GUI_Window.cpp +++ b/src/GUI_Window.cpp @@ -43,13 +43,18 @@ auto GUI_Window::handle(int e) -> int { this->child(3)->label(position_to_string(x,y)); if (Fl::event_button() == FL_LEFT_MOUSE) { this->child(2)->label("Event:Mouse Left Drag"); + vkvm::callEvent(vkvm::EventType::MouseLeftDown); + vkvm::callEvent(vkvm::EventType::MouseMove); } else if (Fl::event_button() == FL_RIGHT_MOUSE) { this->child(2)->label("Event:Mouse Right Drag"); + vkvm::callEvent(vkvm::EventType::MouseRightDown); + vkvm::callEvent(vkvm::EventType::MouseMove); } else { this->child(2)->label("Event:Mouse Middle Drag"); + vkvm::callEvent(vkvm::EventType::MouseMiddleDown); + vkvm::callEvent(vkvm::EventType::MouseMove); } - vkvm::callEvent(vkvm::EventType::MouseLeftDown); - vkvm::callEvent(vkvm::EventType::MouseMove); + return 1; /*Mousemovement*/ case FL_MOVE: