diff --git a/engine/main.cpp b/engine/main.cpp index 5f19129..1618dec 100644 --- a/engine/main.cpp +++ b/engine/main.cpp @@ -195,17 +195,17 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime - (void)mouseDown:(NSEvent *)theEvent { auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - App::I.mouse_down(0, mouseLoc.x, mouseLoc.y); + App::I.mouse_down(0, mouseLoc.x, App::I.height - mouseLoc.y - 1); } - (void)mouseUp:(NSEvent *)theEvent { auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - App::I.mouse_up(0, mouseLoc.x, mouseLoc.y); + App::I.mouse_up(0, mouseLoc.x, App::I.height - mouseLoc.y - 1); } - (void)mouseMoved:(NSEvent *)theEvent { auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - App::I.mouse_move(mouseLoc.x, mouseLoc.y); + App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1); } @end @@ -261,6 +261,8 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime [window center]; [window makeKeyAndOrderFront:controller]; [window setContentView:view]; + [window setAcceptsMouseMovedEvents:true]; + [window makeFirstResponder:view]; controller = [[Controller alloc] initWithWindow:window];