diff options
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/player.cpp b/src/player.cpp index f40a1d1..1f950df 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -71,6 +71,12 @@ void PlayerSystem::receive(const KeyDownEvent& kue) el.tryListener("JumpKeyPressed", e.component<Scripted>()->caller); }); + } else if (kue.sym == SDLK_LSHIFT) { + entities.each<EventListener>( + [](entityx::Entity e, EventListener& el) { + el.tryListener("CrouchKeyPressed", + e.component<Scripted>()->caller); + }); } } } @@ -96,6 +102,12 @@ void PlayerSystem::receive(const KeyUpEvent& kue) el.tryListener("JumpKeyReleased", e.component<Scripted>()->caller); }); + } else if (kue.sym == SDLK_LSHIFT) { + entities.each<EventListener>( + [](entityx::Entity e, EventListener& el) { + el.tryListener("CrouchKeyReleased", + e.component<Scripted>()->caller); + }); } } } |