From 97e9d2db6c09d93a5a27d1b81aca449c88d37e75 Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Thu, 5 Mar 2015 22:22:51 +0100 Subject: [PATCH] Temporary solution for middle click. --- examples/common/entry/entry_osx.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/common/entry/entry_osx.mm b/examples/common/entry/entry_osx.mm index 200791870..186d3bf0e 100644 --- a/examples/common/entry/entry_osx.mm +++ b/examples/common/entry/entry_osx.mm @@ -247,7 +247,12 @@ namespace entry { int x, y; getMousePos(&x, &y); - m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Left, true); + + // TODO: remove! + // Shift + Left Mouse Button acts as middle! This just a temporary solution! + // This is becase the average OSX user doesn't have middle mouse click. + MouseButton::Enum mb = ([event modifierFlags] & NSShiftKeyMask) ? MouseButton::Middle : MouseButton::Left; + m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, mb, true); break; } @@ -256,6 +261,7 @@ namespace entry int x, y; getMousePos(&x, &y); m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Left, false); + m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Middle, false); // TODO: remove! break; }