added partial mouse events on osx

This commit is contained in:
Omar Mohamed Ali Mudhir
2017-01-25 19:06:49 +00:00
parent 2f042c3e95
commit 9a4abe8bde
4 changed files with 73 additions and 31 deletions

View File

@@ -192,6 +192,21 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
[super renewGState];
}
- (void)mouseDown:(NSEvent *)theEvent
{
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
App::I.mouse_down(0, mouseLoc.x, mouseLoc.y);
}
- (void)mouseUp:(NSEvent *)theEvent
{
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
App::I.mouse_up(0, mouseLoc.x, mouseLoc.y);
}
- (void)mouseMoved:(NSEvent *)theEvent
{
auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
App::I.mouse_move(mouseLoc.x, mouseLoc.y);
}
@end
@interface Window : NSWindow