Event queue refactor

This commit is contained in:
elasota
2019-12-31 03:55:17 -05:00
parent 84e4f9fb0b
commit 52338a3983
25 changed files with 244 additions and 297 deletions

View File

@@ -0,0 +1,22 @@
#include "PLTimeTaggedVOSEvent.h"
// Helpers for common cases
bool TimeTaggedVOSEvent::IsKeyDownEvent() const
{
if (m_vosEvent.m_eventType != GpVOSEventTypes::kKeyboardInput)
return false;
const GpKeyboardInputEvent &keyboardEvent = m_vosEvent.m_event.m_keyboardInputEvent;
return keyboardEvent.m_eventType == GpKeyboardInputEventTypes::kDown;
}
bool TimeTaggedVOSEvent::IsLMouseDownEvent() const
{
if (m_vosEvent.m_eventType != GpVOSEventTypes::kMouseInput)
return false;
const GpMouseInputEvent &mouseEvent = m_vosEvent.m_event.m_mouseInputEvent;
return mouseEvent.m_eventType == GpMouseEventTypes::kDown && mouseEvent.m_button == GpMouseButtons::kLeft;
}