33 #if defined(_WIN32) && defined(HR_ENGINE_SHARED) 35 # define MR_DllDeclare __declspec( dllexport ) 37 # define MR_DllDeclare __declspec( dllimport ) 40 # define MR_DllDeclare 44 namespace MainCharacter {
128 CONSOLE_TOGGLE = 0x04,
136 std::shared_ptr<Action<stringSignal_t, const std::string&>>;
138 std::shared_ptr<Action<textControlSignal_t, TextControl::key_t>>;
141 std::shared_ptr<Action<mouseClickSignal_t, const Mouse::Click&>>;
143 std::shared_ptr<Action<mouseScrollSignal_t, const Mouse::Scroll&>>;
146 bool OnKeyPressed(
const SDL_KeyboardEvent &arg);
147 bool OnKeyReleased(
const SDL_KeyboardEvent &arg);
148 bool OnTextInput(
const SDL_TextInputEvent &evt);
149 bool OnMouseMoved(
const SDL_MouseMotionEvent &evt);
150 bool OnMousePressed(
const SDL_MouseButtonEvent &evt);
151 bool OnMouseReleased(
const SDL_MouseButtonEvent &evt);
152 bool OnMouseWheel(
const SDL_MouseWheelEvent &evt);
160 void ProcessInputEvent(
const SDL_Event &evt);
161 void HandleEvent(
int hash,
int value);
175 void CaptureNextInput(
int oldhash, std::string mapname);
198 void DisableCaptureInput();
206 void ClearActionMap();
218 bool AddActionMap(
const std::string &mapname,
ActionMapId mapId);
227 return (activeMaps | static_cast<size_t>(
id)) != 0;
233 ActionMap& GetActionMap(std::string key);
238 std::vector<std::string> GetAvailableMaps();
252 void AddCameraMaps();
254 void AddConsoleToggleMaps();
255 void AddConsoleMaps();
259 static std::string HashToString(
int hash);
260 SDL_Keycode StringToKey(
const std::string &s);
263 void LoadCameraMap();
265 void LoadConsoleToggleMap();
266 void LoadConsoleMap();
274 void RebindKey(std::string mapname,
int oldhash,
int newhash);
306 int GetNextAvailableDisabledHash();
309 static int HashKeyboardEvent(
const SDL_Keycode& arg);
310 static int HashMouseButtonEvent(
const SDL_MouseButtonEvent& arg);
311 static int HashMouseAxisEvent(
axis_t axis,
int direction);
327 std::unordered_map<SDL_Keycode, VoidActionPtr>
hotkeys;
std::shared_ptr< InputHandler > InputHandlerPtr
Definition: Controller.h:52
bool jump
Definition: Controller.h:63
bool right
Definition: Controller.h:68
bool motorOn
Definition: Controller.h:62
bool fire
Definition: Controller.h:65
#define MR_DllDeclare
Definition: Controller.h:40
bool weapon
Definition: Controller.h:66
bool left
Definition: Controller.h:69
Definition: Announcement.h:24
bool lookBack
Definition: Controller.h:67
Definition: Controller.h:60
Definition: MainCharacter.h:62
bool brake
Definition: Controller.h:64