|
|
@ -3,18 +3,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include <SDL_events.h>
|
|
|
|
#include <SDL_events.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <components/lua/luastate.hpp>
|
|
|
|
|
|
|
|
#include <components/lua/scriptscontainer.hpp>
|
|
|
|
|
|
|
|
#include <components/sdlutil/events.hpp>
|
|
|
|
#include <components/sdlutil/events.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
#include "../mwbase/luamanager.hpp"
|
|
|
|
#include "../mwbase/luamanager.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
namespace MWLua
|
|
|
|
namespace MWLua
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
template <class Container>
|
|
|
|
class InputProcessor
|
|
|
|
class InputProcessor
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
InputProcessor(LuaUtil::ScriptsContainer* scriptsContainer)
|
|
|
|
InputProcessor(Container* scriptsContainer)
|
|
|
|
: mScriptsContainer(scriptsContainer)
|
|
|
|
: mScriptsContainer(scriptsContainer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mScriptsContainer->registerEngineHandlers({ &mKeyPressHandlers, &mKeyReleaseHandlers,
|
|
|
|
mScriptsContainer->registerEngineHandlers({ &mKeyPressHandlers, &mKeyReleaseHandlers,
|
|
|
@ -58,15 +57,15 @@ namespace MWLua
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
LuaUtil::ScriptsContainer* mScriptsContainer;
|
|
|
|
Container* mScriptsContainer;
|
|
|
|
LuaUtil::ScriptsContainer::EngineHandlerList mKeyPressHandlers{ "onKeyPress" };
|
|
|
|
Container::EngineHandlerList mKeyPressHandlers{ "onKeyPress" };
|
|
|
|
LuaUtil::ScriptsContainer::EngineHandlerList mKeyReleaseHandlers{ "onKeyRelease" };
|
|
|
|
Container::EngineHandlerList mKeyReleaseHandlers{ "onKeyRelease" };
|
|
|
|
LuaUtil::ScriptsContainer::EngineHandlerList mControllerButtonPressHandlers{ "onControllerButtonPress" };
|
|
|
|
Container::EngineHandlerList mControllerButtonPressHandlers{ "onControllerButtonPress" };
|
|
|
|
LuaUtil::ScriptsContainer::EngineHandlerList mControllerButtonReleaseHandlers{ "onControllerButtonRelease" };
|
|
|
|
Container::EngineHandlerList mControllerButtonReleaseHandlers{ "onControllerButtonRelease" };
|
|
|
|
LuaUtil::ScriptsContainer::EngineHandlerList mActionHandlers{ "onInputAction" };
|
|
|
|
Container::EngineHandlerList mActionHandlers{ "onInputAction" };
|
|
|
|
LuaUtil::ScriptsContainer::EngineHandlerList mTouchpadPressed{ "onTouchPress" };
|
|
|
|
Container::EngineHandlerList mTouchpadPressed{ "onTouchPress" };
|
|
|
|
LuaUtil::ScriptsContainer::EngineHandlerList mTouchpadReleased{ "onTouchRelease" };
|
|
|
|
Container::EngineHandlerList mTouchpadReleased{ "onTouchRelease" };
|
|
|
|
LuaUtil::ScriptsContainer::EngineHandlerList mTouchpadMoved{ "onTouchMove" };
|
|
|
|
Container::EngineHandlerList mTouchpadMoved{ "onTouchMove" };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|