aboutsummaryrefslogtreecommitdiff
path: root/src/client/inputhandler.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-02-23 14:21:15 +0100
committersfan5 <sfan5@live.de>2021-02-23 19:41:38 +0100
commit9b59b2f75de8a523cba255335fb8d9350716c8c5 (patch)
tree928d961d3d6cdad04265f5cdb535186f77ee1222 /src/client/inputhandler.cpp
parent35b476c65df9c78935e166b94ca686015b43960f (diff)
downloadminetest-9b59b2f75de8a523cba255335fb8d9350716c8c5.tar.gz
minetest-9b59b2f75de8a523cba255335fb8d9350716c8c5.tar.bz2
minetest-9b59b2f75de8a523cba255335fb8d9350716c8c5.zip
Fix keyWasDown in input handler
This was changed 291a6b70d674d9003f522b5875a60f7e2753e32b but should have never been done.
Diffstat (limited to 'src/client/inputhandler.cpp')
-rw-r--r--src/client/inputhandler.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/client/inputhandler.cpp b/src/client/inputhandler.cpp
index 608a405a8..978baa320 100644
--- a/src/client/inputhandler.cpp
+++ b/src/client/inputhandler.cpp
@@ -113,17 +113,12 @@ bool MyEventReceiver::OnEvent(const SEvent &event)
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
const KeyPress &keyCode = event.KeyInput;
if (keysListenedFor[keyCode]) {
- // If the key is being held down then the OS may
- // send a continuous stream of keydown events.
- // In this case, we don't want to let this
- // stream reach the application as it will cause
- // certain actions to repeat constantly.
if (event.KeyInput.PressedDown) {
- if (!IsKeyDown(keyCode)) {
- keyWasDown.set(keyCode);
+ if (!IsKeyDown(keyCode))
keyWasPressed.set(keyCode);
- }
+
keyIsDown.set(keyCode);
+ keyWasDown.set(keyCode);
} else {
if (IsKeyDown(keyCode))
keyWasReleased.set(keyCode);