Index: src/toolbar_gui.cpp =================================================================== --- src/toolbar_gui.cpp (revision 22898) +++ src/toolbar_gui.cpp (working copy) @@ -1691,8 +1691,8 @@ }; const uint16 _maintoolbar_pause_keys[] = {WKC_F1, WKC_PAUSE, 0}; -const uint16 _maintoolbar_zoomin_keys[] = {WKC_NUM_PLUS, WKC_EQUALS, WKC_SHIFT | WKC_EQUALS, WKC_SHIFT | WKC_F5, 0}; -const uint16 _maintoolbar_zoomout_keys[] = {WKC_NUM_MINUS, WKC_MINUS, WKC_SHIFT | WKC_MINUS, WKC_SHIFT | WKC_F6, 0}; +const uint16 _maintoolbar_zoomin_keys[] = {WKC_NUM_PLUS, WKC_EQUALS, WKC_SHIFT | WKC_EQUALS, WKC_SHIFT | WKC_F5, WKC_TOUCH_ZOOM_IN, 0}; +const uint16 _maintoolbar_zoomout_keys[] = {WKC_NUM_MINUS, WKC_MINUS, WKC_SHIFT | WKC_MINUS, WKC_SHIFT | WKC_F6, WKC_TOUCH_ZOOM_OUT, 0}; const uint16 _maintoolbar_smallmap_keys[] = {WKC_F4, 'M', 0}; Hotkey MainToolbarWindow::maintoolbar_hotkeys[] = { Index: src/video/cocoa/event.mm =================================================================== --- src/video/cocoa/event.mm (revision 22898) +++ src/video/cocoa/event.mm (working copy) @@ -58,6 +58,9 @@ static unsigned int _current_mods; static bool _tab_is_down; static bool _emulating_right_button; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +static float _current_magnification; +#endif #ifdef _DEBUG static uint32 _tEvent; #endif @@ -486,6 +489,25 @@ QZ_MouseButtonEvent([ event buttonNumber ], NO); break; #endif + + #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + case NSEventTypeMagnify: + _current_magnification += [event magnification] * 5.f; + + while(_current_magnification >= 1.f) { + _current_magnification -= 1.f; + HandleKeypress(WKC_TOUCH_ZOOM_IN << 16); + } + + while(_current_magnification <= -1.f) { + _current_magnification += 1.f; + HandleKeypress(WKC_TOUCH_ZOOM_OUT << 16); + } + break; + case NSEventTypeEndGesture: + _current_magnification = 0; + break; + #endif case NSKeyDown: /* Quit, hide and minimize */ Index: src/gfx_type.h =================================================================== --- src/gfx_type.h (revision 22898) +++ src/gfx_type.h (working copy) @@ -104,6 +104,10 @@ WKC_COMMA = 151, ///< , Comma WKC_PERIOD = 152, ///< . Period WKC_MINUS = 153, ///< - Minus + + /* Touchpad gestures */ + WKC_TOUCH_ZOOM_IN = 154, ///< Pinch zoom in + WKC_TOUCH_ZOOM_OUT = 155, ///< Reverse pinch / zoom out }; /** A single sprite of a list of animated cursors */ Index: src/hotkeys.cpp =================================================================== --- src/hotkeys.cpp (revision 22898) +++ src/hotkeys.cpp (working copy) @@ -54,6 +54,8 @@ {"NUM_MINUS", WKC_NUM_MINUS}, {"=", WKC_EQUALS}, {"-", WKC_MINUS}, + {"TOUCH_ZOOM_IN", WKC_TOUCH_ZOOM_IN}, + {"TOUCH_ZOOM_OUT", WKC_TOUCH_ZOOM_OUT}, }; /**