更新了键盘消息函数
This commit is contained in:
parent
c23d7e4066
commit
e2c796ee59
|
|
@ -9,6 +9,8 @@ int WINAPI WinMain(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EApp app;
|
EApp app;
|
||||||
|
auto listenerCallback = [](EPoint p) {};
|
||||||
|
auto s = new EListenerMouseClick(listenerCallback);
|
||||||
if (app.init(L"Easy2D Demo", 640, 480))
|
if (app.init(L"Easy2D Demo", 640, 480))
|
||||||
{
|
{
|
||||||
float w = EApp::getWidth();
|
float w = EApp::getWidth();
|
||||||
|
|
@ -24,7 +26,7 @@ int WINAPI WinMain(
|
||||||
scene->add(text);
|
scene->add(text);
|
||||||
|
|
||||||
auto listener = new EListenerKeyboardPress([=]() {
|
auto listener = new EListenerKeyboardPress([=]() {
|
||||||
if (EKeyboardMsg::getVal() == EKeyboardMsg::KEY::SPACE)
|
if (EKeyboardMsg::getKeyValue() == EKeyboardMsg::KEY::SPACE)
|
||||||
{
|
{
|
||||||
EApp::backScene(new ETransitionFade(0.5f, 0.5f));
|
EApp::backScene(new ETransitionFade(0.5f, 0.5f));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ e2d::EKeyboardMsg::KEYBOARD_MSG e2d::EKeyboardMsg::getMsg()
|
||||||
return KEYBOARD_MSG(EKeyboardMsg::s_nMsg);
|
return KEYBOARD_MSG(EKeyboardMsg::s_nMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
e2d::EKeyboardMsg::KEY e2d::EKeyboardMsg::getVal()
|
e2d::EKeyboardMsg::KEY e2d::EKeyboardMsg::getKeyValue()
|
||||||
{
|
{
|
||||||
return KEY(EKeyboardMsg::s_wParam);
|
return KEY(EKeyboardMsg::s_wParam);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ public:
|
||||||
static KEYBOARD_MSG getMsg();
|
static KEYBOARD_MSG getMsg();
|
||||||
|
|
||||||
// 获取键值
|
// 获取键值
|
||||||
static KEY getVal();
|
static KEY getKeyValue();
|
||||||
|
|
||||||
// 获取按键消息的计数
|
// 获取按键消息的计数
|
||||||
static DWORD getCount();
|
static DWORD getCount();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue