Fixed build.

This commit is contained in:
Branimir Karadžić 2017-07-15 15:37:40 -07:00
parent 10c9fca9a8
commit 127328d1db
1 changed files with 37 additions and 49 deletions

View File

@ -271,66 +271,52 @@ namespace entry
switch (eventType)
{
case NSMouseMoved:
case NSLeftMouseDragged:
case NSRightMouseDragged:
case NSOtherMouseDragged:
{
getMousePos(&m_mx, &m_my);
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll);
break;
}
case NSMouseMoved:
case NSLeftMouseDragged:
case NSRightMouseDragged:
case NSOtherMouseDragged:
getMousePos(&m_mx, &m_my);
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll);
break;
case NSLeftMouseDown:
case NSLeftMouseDown:
{
// Command + Left Mouse Button acts as middle! This just a temporary solution!
// This is because the average OSX user doesn't have middle mouse click.
MouseButton::Enum mb = ([event modifierFlags] & NSCommandKeyMask) ? MouseButton::Middle : MouseButton::Left;
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, mb, true);
break;
}
break;
case NSLeftMouseUp:
{
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Left, false);
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Middle, false); // TODO: remove!
break;
}
case NSLeftMouseUp:
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Left, false);
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Middle, false); // TODO: remove!
break;
case NSRightMouseDown:
{
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Right, true);
break;
}
case NSRightMouseDown:
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Right, true);
break;
case NSRightMouseUp:
{
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Right, false);
break;
}
case NSRightMouseUp:
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Right, false);
break;
case NSOtherMouseDown:
{
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Middle, true);
break;
}
case NSOtherMouseDown:
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Middle, true);
break;
case NSOtherMouseUp:
{
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Middle, false);
break;
}
case NSOtherMouseUp:
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Middle, false);
break;
case NSScrollWheel:
{
m_scrollf += [event deltaY];
case NSScrollWheel:
m_scrollf += [event deltaY];
m_scroll = (int32_t)m_scrollf;
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll);
break;
}
m_scroll = (int32_t)m_scrollf;
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll);
break;
case NSKeyDown:
case NSKeyDown:
{
uint8_t modifiers = 0;
uint8_t pressedChar[4];
@ -351,11 +337,10 @@ namespace entry
return false;
}
}
break;
}
break;
case NSKeyUp:
case NSKeyUp:
{
uint8_t modifiers = 0;
uint8_t pressedChar[4];
@ -369,8 +354,11 @@ namespace entry
return false;
}
break;
}
break;
default:
break;
}
[NSApp sendEvent:event];