julien581 2020-09-23 14:30:54 -03:00 committed by phkahler
parent c021df33c0
commit c514ddad54
1 changed files with 13 additions and 1 deletions

View File

@ -458,13 +458,25 @@ MenuBarRef GetOrCreateMainMenu(bool *unique) {
}
}
- (void)mouseMotionEvent:(NSEvent *)nsEvent withButton:(Platform::MouseEvent::Button)button {
using Platform::MouseEvent;
MouseEvent event = [self convertMouseEvent:nsEvent];
event.type = MouseEvent::Type::MOTION;
event.button = button;
if(receiver->onMouseEvent) {
receiver->onMouseEvent(event);
}
}
- (void)mouseMoved:(NSEvent *)nsEvent {
[self mouseMotionEvent:nsEvent];
[super mouseMoved:nsEvent];
}
- (void)mouseDragged:(NSEvent *)nsEvent {
[self mouseMotionEvent:nsEvent];
[self mouseMotionEvent:nsEvent withButton:Platform::MouseEvent::Button::LEFT];
}
- (void)otherMouseDragged:(NSEvent *)nsEvent {