File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -113,17 +113,12 @@ bool MyEventReceiver::OnEvent(const SEvent &event)
113
113
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
114
114
const KeyPress &keyCode = event.KeyInput ;
115
115
if (keysListenedFor[keyCode]) {
116
- // If the key is being held down then the OS may
117
- // send a continuous stream of keydown events.
118
- // In this case, we don't want to let this
119
- // stream reach the application as it will cause
120
- // certain actions to repeat constantly.
121
116
if (event.KeyInput .PressedDown ) {
122
- if (!IsKeyDown (keyCode)) {
123
- keyWasDown.set (keyCode);
117
+ if (!IsKeyDown (keyCode))
124
118
keyWasPressed.set (keyCode);
125
- }
119
+
126
120
keyIsDown.set (keyCode);
121
+ keyWasDown.set (keyCode);
127
122
} else {
128
123
if (IsKeyDown (keyCode))
129
124
keyWasReleased.set (keyCode);
Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ class MyEventReceiver : public IEventReceiver
201
201
// The current state of keys
202
202
KeyList keyIsDown;
203
203
204
- // Whether a key was down
204
+ // Like keyIsDown but only reset when that key is read
205
205
KeyList keyWasDown;
206
206
207
207
// Whether a key has just been pressed
You can’t perform that action at this time.
0 commit comments