diff options
Diffstat (limited to 'src/client/inputhandler.h')
-rw-r--r-- | src/client/inputhandler.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/client/inputhandler.h b/src/client/inputhandler.h index ef5f6fb32..e006affb2 100644 --- a/src/client/inputhandler.h +++ b/src/client/inputhandler.h @@ -218,7 +218,10 @@ public: virtual ~InputHandler() = default; - virtual bool isRandom() const { return false; } + virtual bool isRandom() const + { + return false; + } virtual bool isKeyDown(GameKeyType k) = 0; virtual void setKeypress(const KeyPress &keyCode) = 0; @@ -374,7 +377,7 @@ public: m_receiver->clearInput(); } -private: + private: MyEventReceiver *m_receiver = nullptr; v2s32 m_mousepos; }; @@ -384,11 +387,20 @@ class RandomInputHandler : public InputHandler public: RandomInputHandler() = default; - bool isRandom() const { return true; } + bool isRandom() const + { + return true; + } virtual bool isKeyDown(GameKeyType k) { return keydown[keycache.key[k]]; } - virtual void setKeypress(const KeyPress &keyCode) { keydown.set(keyCode); } - virtual void unsetKeypress(const KeyPress &keyCode) { keydown.unset(keyCode); } + virtual void setKeypress(const KeyPress &keyCode) + { + keydown.set(keyCode); + } + virtual void unsetKeypress(const KeyPress &keyCode) + { + keydown.unset(keyCode); + } virtual bool wasKeyDown(GameKeyType k) { return false; } virtual bool cancelPressed() { return false; } virtual v2s32 getMousePos() { return mousepos; } |