更新了键盘消息函数

This commit is contained in:
Nomango 2017-11-04 18:21:46 +08:00
parent c23d7e4066
commit e2c796ee59
3 changed files with 5 additions and 3 deletions

View File

@ -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));
}

View File

@ -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);
}

View File

@ -281,7 +281,7 @@ public:
static KEYBOARD_MSG getMsg();
// 获取键值
static KEY getVal();
static KEY getKeyValue();
// 获取按键消息的计数
static DWORD getCount();