put callEvent at the end
This commit is contained in:
parent
66f356c6a1
commit
cc91a8d60d
@ -6,7 +6,6 @@ auto GUI_Window::handle(int e) -> int {
|
||||
switch (e) {
|
||||
/*Mousebutton*/
|
||||
case FL_PUSH:
|
||||
vkvm::callEvent(vkvm::EventType::MouseButton);
|
||||
if (Fl::event_button() == FL_LEFT_MOUSE) {
|
||||
std::cout << "Mouse:left" << std::endl;
|
||||
} else if (Fl::event_button() == FL_RIGHT_MOUSE) {
|
||||
@ -14,11 +13,10 @@ auto GUI_Window::handle(int e) -> int {
|
||||
} else {
|
||||
std::cout << "Mouse:middle" << std::endl;
|
||||
}
|
||||
vkvm::callEvent(vkvm::EventType::MouseButton);
|
||||
return 1;
|
||||
/*Mousebutton and movement*/
|
||||
case FL_DRAG:
|
||||
vkvm::callEvent(vkvm::EventType::MouseButton);
|
||||
vkvm::callEvent(vkvm::EventType::MouseMove);
|
||||
x = Fl::event_x();
|
||||
y = Fl::event_y();
|
||||
vkvm::setMousePosition(x,y);
|
||||
@ -29,27 +27,29 @@ auto GUI_Window::handle(int e) -> int {
|
||||
} else {
|
||||
std::cout << "Mouse:middle" << std::endl;
|
||||
}
|
||||
vkvm::callEvent(vkvm::EventType::MouseButton);
|
||||
vkvm::callEvent(vkvm::EventType::MouseMove);
|
||||
return 1;
|
||||
/*Mousemovement*/
|
||||
case FL_MOVE:
|
||||
vkvm::callEvent(vkvm::EventType::MouseMove);
|
||||
x = Fl::event_x();
|
||||
y = Fl::event_y();
|
||||
vkvm::setMousePosition(x,y);
|
||||
vkvm::callEvent(vkvm::EventType::MouseMove);
|
||||
return 1;
|
||||
/*keyboardbutton*/
|
||||
case FL_KEYBOARD:
|
||||
vkvm::callEvent(vkvm::EventType::KeyDown);
|
||||
button = Fl::event_button();
|
||||
keyCode = new vkvm::KeyCode(button);
|
||||
vkvm::buttonPressed(*keyCode);
|
||||
vkvm::callEvent(vkvm::EventType::KeyDown);
|
||||
return 1;
|
||||
case FL_KEYUP:
|
||||
vkvm::callEvent(vkvm::EventType::KeyUp);
|
||||
button = Fl::event_button();
|
||||
std::cout<<button<<std::endl;
|
||||
keyCode = new vkvm::KeyCode(button);
|
||||
vkvm::buttonPressed(*keyCode);
|
||||
vkvm::callEvent(vkvm::EventType::KeyUp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user