2021-03-01 14:35:00 -08:00
|
|
|
#include <irrlicht.h>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace irr;
|
|
|
|
|
|
|
|
class AppEventReceiver : public IEventReceiver
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AppEventReceiver() : isEscPressed(false), camera_input(nullptr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool OnEvent(const SEvent& event)
|
|
|
|
{
|
2021-03-23 11:26:57 -07:00
|
|
|
|
2021-03-01 14:35:00 -08:00
|
|
|
if (event.EventType == EET_KEY_INPUT_EVENT &&
|
|
|
|
event.KeyInput.Key == KEY_ESCAPE &&
|
|
|
|
event.KeyInput.PressedDown
|
|
|
|
)
|
|
|
|
{
|
|
|
|
isEscPressed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isEscPressed;
|
|
|
|
|
|
|
|
scene::ICameraSceneNode* camera_input;
|
|
|
|
};
|