diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/game.cpp | 20 | ||||
-rw-r--r-- | src/client/game.h | 20 | ||||
-rw-r--r-- | src/script/cpp_api/s_client.h | 4 |
3 files changed, 27 insertions, 17 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp index 69feeef97..5893e8ac9 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -3373,6 +3373,26 @@ void Game::readSettings() m_does_lost_focus_pause_game = g_settings->getBool("pause_on_lost_focus"); } +bool Game::isKeyDown(GameKeyType k) +{ + return input->isKeyDown(k); +} + +bool Game::wasKeyDown(GameKeyType k) +{ + return input->wasKeyDown(k); +} + +bool Game::wasKeyPressed(GameKeyType k) +{ + return input->wasKeyPressed(k); +} + +bool Game::wasKeyReleased(GameKeyType k) +{ + return input->wasKeyReleased(k); +} + /****************************************************************************/ /**************************************************************************** Shutdown / cleanup diff --git a/src/client/game.h b/src/client/game.h index 26117ab86..3e80b15e7 100644 --- a/src/client/game.h +++ b/src/client/game.h @@ -792,22 +792,10 @@ public: static void updateAllMapBlocksCallback(const std::string &setting_name, void *data); void readSettings(); - inline bool isKeyDown(GameKeyType k) - { - return input->isKeyDown(k); - } - inline bool wasKeyDown(GameKeyType k) - { - return input->wasKeyDown(k); - } - inline bool wasKeyPressed(GameKeyType k) - { - return input->wasKeyPressed(k); - } - inline bool wasKeyReleased(GameKeyType k) - { - return input->wasKeyReleased(k); - } + bool isKeyDown(GameKeyType k); + bool wasKeyDown(GameKeyType k); + bool wasKeyPressed(GameKeyType k); + bool wasKeyReleased(GameKeyType k); #ifdef __ANDROID__ void handleAndroidChatInput(); diff --git a/src/script/cpp_api/s_client.h b/src/script/cpp_api/s_client.h index ff1c473ae..26fa7abea 100644 --- a/src/script/cpp_api/s_client.h +++ b/src/script/cpp_api/s_client.h @@ -58,7 +58,9 @@ public: bool on_punchnode(v3s16 p, MapNode node); bool on_placenode(const PointedThing &pointed, const ItemDefinition &item); bool on_item_use(const ItemStack &item, const PointedThing &pointed); - bool on_recieve_physics_override(float override_speed, float override_jump, float override_gravity, bool sneak, bool sneak_glitch, bool new_move); + bool on_recieve_physics_override(float override_speed, float override_jump, + float override_gravity, bool sneak, bool sneak_glitch, + bool new_move); bool on_play_sound(SimpleSoundSpec spec); bool on_spawn_particle(struct ParticleParameters param); |