diff options
author | David Robillard <d@drobilla.net> | 2014-07-16 03:15:04 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-07-16 03:15:04 +0000 |
commit | 8eeed6d3468cb2635176ec4a973954eb29043d89 (patch) | |
tree | d1beb787bb4e9a634d702747baead7f635ffeeb1 /pugl/pugl_osx.m | |
parent | c6454d69b012d1023f375686cba29d6344ccc1d5 (diff) | |
download | pugl-8eeed6d3468cb2635176ec4a973954eb29043d89.tar.gz pugl-8eeed6d3468cb2635176ec4a973954eb29043d89.tar.bz2 pugl-8eeed6d3468cb2635176ec4a973954eb29043d89.zip |
Various minor fixes (#953).
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r-- | pugl/pugl_osx.m | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m index 346d833..7e543a8 100644 --- a/pugl/pugl_osx.m +++ b/pugl/pugl_osx.m @@ -1,5 +1,5 @@ /* - Copyright 2012 David Robillard <http://drobilla.net> + Copyright 2012-2014 David Robillard <http://drobilla.net> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -36,6 +36,7 @@ defer:(BOOL)flag; - (void) setPuglview:(PuglView*)view; - (BOOL) windowShouldClose:(id)sender; +- (BOOL) canBecomeKeyWindow:(id)sender; @end @implementation PuglWindow @@ -80,6 +81,11 @@ return YES; } +- (BOOL) canBecomeKeyWindow:(id)sender +{ + return NO; +} + @end static void @@ -112,6 +118,7 @@ puglDisplay(PuglView* view) - (void) rightMouseDragged:(NSEvent*)event; - (void) mouseDown:(NSEvent*)event; - (void) mouseUp:(NSEvent*)event; +- (void) rightMouseDragged:(NSEvent*)event; - (void) rightMouseDown:(NSEvent*)event; - (void) rightMouseUp:(NSEvent*)event; - (void) scrollWheel:(NSEvent*)event; @@ -261,6 +268,15 @@ getModifiers(PuglView* view, NSEvent* ev) } } +- (void) rightMouseDragged:(NSEvent*)event +{ + if (puglview->motionFunc) { + NSPoint loc = [event locationInWindow]; + puglview->mods = getModifiers(puglview, event); + puglview->motionFunc(puglview, loc.x, puglview->height - loc.y); + } +} + - (void) mouseDown:(NSEvent*)event { if (puglview->mouseFunc) { |