diff --git a/cocos/2d/platform/winrt/CCGLView.cpp b/cocos/2d/platform/winrt/CCGLView.cpp index 2044330299..90a5568562 100644 --- a/cocos/2d/platform/winrt/CCGLView.cpp +++ b/cocos/2d/platform/winrt/CCGLView.cpp @@ -271,6 +271,61 @@ void WinRTWindow::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ ar GLView::sharedOpenGLView()->handleTouchesEnd(1, &id, &p.x, &p.y); } +// user pressed the Back Key on the phone +void GLView::OnBackKeyPress() +{ +#if 0 + if (m_delegate) + { + m_delegate->Invoke(Cocos2dEvent::TerminateApp); + } +#endif // 0 + +} + + +void GLView::OnPointerPressed(PointerEventArgs^ args) +{ +#if 0 + int id = args->CurrentPoint->PointerId; + Vector2 pt = GetPoint(args); + handleTouchesBegin(1, &id, &pt.x, &pt.y); +#endif +} + +void GLView::OnPointerMoved(PointerEventArgs^ args) +{ +#if 0 + auto currentPoint = args->CurrentPoint; + if (currentPoint->IsInContact) + { + if (m_lastPointValid) + { + int id = args->CurrentPoint->PointerId; + Vector2 p = GetPoint(args); + handleTouchesMove(1, &id, &p.x, &p.y); + } + m_lastPoint = currentPoint->Position; + m_lastPointValid = true; + } + else + { + m_lastPointValid = false; + } +#endif +} + +void GLView::OnPointerReleased(PointerEventArgs^ args) +{ +#if 0 + int id = args->CurrentPoint->PointerId; + Vector2 pt = GetPoint(args); + handleTouchesEnd(1, &id, &pt.x, &pt.y); +#endif // 0 + +} + + void WinRTWindow::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args) { diff --git a/cocos/2d/platform/winrt/CCGLView.h b/cocos/2d/platform/winrt/CCGLView.h index e1c17802df..b51e9adf7f 100644 --- a/cocos/2d/platform/winrt/CCGLView.h +++ b/cocos/2d/platform/winrt/CCGLView.h @@ -30,7 +30,6 @@ THE SOFTWARE. #include "CCGL.h" #include "platform/CCCommon.h" #include "InputEvent.h" -#include "CCGeometry.h" #include "platform/CCGLViewProtocol.h" #include @@ -80,7 +79,7 @@ private: Platform::Agile m_window; - Windows::Foundation::Vector2 m_lastPoint; + Windows::Foundation::Point m_lastPoint; Windows::Foundation::EventRegistrationToken m_eventToken; bool m_lastPointValid; bool m_textInputEnabled; @@ -114,9 +113,16 @@ public: void OnSuspending(); void GLView::QueueEvent(std::shared_ptr& event); + void OnPointerPressed(Windows::UI::Core::PointerEventArgs^ args); + void OnPointerMoved(Windows::UI::Core::PointerEventArgs^ args); + void OnPointerReleased(Windows::UI::Core::PointerEventArgs^ args); + void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); + void OnBackKeyPress(); + + private: Windows::Foundation::EventRegistrationToken m_eventToken; - Windows::Foundation::Vector2 m_lastPoint; + Windows::Foundation::Point m_lastPoint; bool m_lastPointValid; public: