From e2c796ee5940aadb521dc6c2e06190e4ae41f1b6 Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Sat, 4 Nov 2017 18:21:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E9=94=AE=E7=9B=98?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Demo/main.cpp | 4 +++- Easy2D/Common/EKeyboardMsg.cpp | 2 +- Easy2D/ecommon.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Demo/main.cpp b/Demo/main.cpp index af192623..a1ee6002 100644 --- a/Demo/main.cpp +++ b/Demo/main.cpp @@ -9,6 +9,8 @@ int WINAPI WinMain( ) { EApp app; + auto listenerCallback = [](EPoint p) {}; + auto s = new EListenerMouseClick(listenerCallback); if (app.init(L"Easy2D Demo", 640, 480)) { float w = EApp::getWidth(); @@ -24,7 +26,7 @@ int WINAPI WinMain( scene->add(text); auto listener = new EListenerKeyboardPress([=]() { - if (EKeyboardMsg::getVal() == EKeyboardMsg::KEY::SPACE) + if (EKeyboardMsg::getKeyValue() == EKeyboardMsg::KEY::SPACE) { EApp::backScene(new ETransitionFade(0.5f, 0.5f)); } diff --git a/Easy2D/Common/EKeyboardMsg.cpp b/Easy2D/Common/EKeyboardMsg.cpp index ceb6393a..821a9d2f 100644 --- a/Easy2D/Common/EKeyboardMsg.cpp +++ b/Easy2D/Common/EKeyboardMsg.cpp @@ -9,7 +9,7 @@ e2d::EKeyboardMsg::KEYBOARD_MSG e2d::EKeyboardMsg::getMsg() return KEYBOARD_MSG(EKeyboardMsg::s_nMsg); } -e2d::EKeyboardMsg::KEY e2d::EKeyboardMsg::getVal() +e2d::EKeyboardMsg::KEY e2d::EKeyboardMsg::getKeyValue() { return KEY(EKeyboardMsg::s_wParam); } diff --git a/Easy2D/ecommon.h b/Easy2D/ecommon.h index 6177b88b..530087f6 100644 --- a/Easy2D/ecommon.h +++ b/Easy2D/ecommon.h @@ -281,7 +281,7 @@ public: static KEYBOARD_MSG getMsg(); // 获取键值 - static KEY getVal(); + static KEY getKeyValue(); // 获取按键消息的计数 static DWORD getCount();