fix flag_drag

This commit is contained in:
Shaohua Tong 2019-11-29 14:48:31 +01:00
parent 5747b8b5fb
commit 44658873a3
1 changed files with 7 additions and 2 deletions

View File

@ -43,13 +43,18 @@ auto GUI_Window::handle(int e) -> int {
this->child(3)->label(position_to_string(x,y)); this->child(3)->label(position_to_string(x,y));
if (Fl::event_button() == FL_LEFT_MOUSE) { if (Fl::event_button() == FL_LEFT_MOUSE) {
this->child(2)->label("Event:Mouse Left Drag"); 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) { } else if (Fl::event_button() == FL_RIGHT_MOUSE) {
this->child(2)->label("Event:Mouse Right Drag"); this->child(2)->label("Event:Mouse Right Drag");
vkvm::callEvent(vkvm::EventType::MouseRightDown);
vkvm::callEvent(vkvm::EventType::MouseMove);
} else { } else {
this->child(2)->label("Event:Mouse Middle Drag"); 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; return 1;
/*Mousemovement*/ /*Mousemovement*/
case FL_MOVE: case FL_MOVE: