diff --git a/src/GUI_Window.cpp b/src/GUI_Window.cpp index da0d5f2..9e931c3 100644 --- a/src/GUI_Window.cpp +++ b/src/GUI_Window.cpp @@ -6,6 +6,9 @@ auto GUI_Window::handle(int e) -> int { switch (e) { /*Mousebutton*/ case FL_PUSH: + x = Fl::event_x(); + y = Fl::event_y(); + vkvm::setMousePosition(x,y); if (Fl::event_button() == FL_LEFT_MOUSE) { this->child(2)->label("Event:Mouse Left Down"); vkvm::callEvent(vkvm::EventType::MouseLeftDown); @@ -19,6 +22,9 @@ auto GUI_Window::handle(int e) -> int { return 1; /*Mousebutton and movement*/ case FL_RELEASE: + x = Fl::event_x(); + y = Fl::event_y(); + vkvm::setMousePosition(x,y); if (Fl::event_button() == FL_LEFT_MOUSE) { this->child(2)->label("Event:Mouse Left Up"); vkvm::callEvent(vkvm::EventType::MouseLeftUp); @@ -37,15 +43,12 @@ 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::MouseLeftUp); } else if (Fl::event_button() == FL_RIGHT_MOUSE) { this->child(2)->label("Event:Mouse Right Drag"); - vkvm::callEvent(vkvm::EventType::MouseRightUp); } else { this->child(2)->label("Event:Mouse Middle Drag"); - vkvm::callEvent(vkvm::EventType::MouseMiddleUp); } - vkvm::callEvent(vkvm::EventType::MouseLeftUp); + vkvm::callEvent(vkvm::EventType::MouseLeftDown); vkvm::callEvent(vkvm::EventType::MouseMove); return 1; /*Mousemovement*/