Skip to content

Commit 4429129

Browse files
committed
Fixed OnHold keyboard state
SDL2 repeats key events when key is on hold, but the engine was built without this feature in mind
1 parent 091d081 commit 4429129

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/xrEngine/xr_input.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ void CInput::KeyUpdate()
173173
switch (event.type)
174174
{
175175
case SDL_KEYDOWN:
176+
if (event.key.repeat)
177+
continue;
176178
KBState[event.key.keysym.scancode] = true;
177179
cbStack.back()->IR_OnKeyboardPress(event.key.keysym.scancode);
178180
break;

0 commit comments

Comments
 (0)