diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/GHOST_Types.h | 3 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 13 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowViewCocoa.h | 5 |
3 files changed, 20 insertions, 1 deletions
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index c7c9f91a361..98dd1de867f 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -436,7 +436,8 @@ typedef enum { GHOST_kTrackpadEventScroll, GHOST_kTrackpadEventRotate, GHOST_kTrackpadEventSwipe, /* Reserved, not used for now */ - GHOST_kTrackpadEventMagnify + GHOST_kTrackpadEventMagnify, + GHOST_kTrackpadEventSmartMagnify } GHOST_TTrackpadEventSubTypes; typedef struct { diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index e50e478b9fc..b0e11bd4a96 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1726,6 +1726,19 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) 0)); } break; + case NSEventTypeSmartMagnify: { + NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream]; + GHOST_TInt32 x, y; + window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); + pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, + window, + GHOST_kTrackpadEventSmartMagnify, + x, + y, + 0, + 0)); + } break; + case NSEventTypeRotate: { NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream]; GHOST_TInt32 x, y; diff --git a/intern/ghost/intern/GHOST_WindowViewCocoa.h b/intern/ghost/intern/GHOST_WindowViewCocoa.h index cee40924b73..14c70382916 100644 --- a/intern/ghost/intern/GHOST_WindowViewCocoa.h +++ b/intern/ghost/intern/GHOST_WindowViewCocoa.h @@ -154,6 +154,11 @@ systemCocoa->handleMouseEvent(event); } +- (void)smartMagnifyWithEvent:(NSEvent *)event +{ + systemCocoa->handleMouseEvent(event); +} + - (void)rotateWithEvent:(NSEvent *)event { systemCocoa->handleMouseEvent(event); |