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

@ -275,11 +275,9 @@ namespace entry
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:
{
@ -287,48 +285,36 @@ namespace entry
// 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 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 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 NSScrollWheel:
{
m_scrollf += [event deltaY];
m_scroll = (int32_t)m_scrollf;
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll);
break;
}
case NSKeyDown:
{
@ -351,9 +337,8 @@ namespace entry
return false;
}
}
break;
}
break;
case NSKeyUp:
{
@ -369,8 +354,11 @@ namespace entry
return false;
}
break;
}
break;
default:
break;
}
[NSApp sendEvent:event];