From 6a4eae83165ff9b78be7b28769b5e2721bb0bf8b Mon Sep 17 00:00:00 2001 From: kernelkinetic <67117582+kernelkinetic@users.noreply.github.com> Date: Wed, 14 Oct 2020 17:19:35 +0200 Subject: [PATCH] fixed keyboard stuttering on PLATFORM_RPI and PLATFORM_DRM (https://github.com/raysan5/raylib/issues/1392) --- src/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.c b/src/core.c index f1d7241a4..f99ea99f7 100644 --- a/src/core.c +++ b/src/core.c @@ -5207,7 +5207,7 @@ static void *EventThread(void *arg) while (!CORE.Window.shouldClose) { // Try to read data from the device and only continue if successful - if (read(worker->fd, &event, sizeof(event)) == (int)sizeof(event)) + while(read(worker->fd, &event, sizeof(event)) == (int)sizeof(event)) { // Relative movement parsing if (event.type == EV_REL) @@ -5375,7 +5375,7 @@ static void *EventThread(void *arg) #endif } } - else Wait(5); // Sleep for 5ms to avoid hogging CPU time + Wait(5); // Sleep for 5ms to avoid hogging CPU time } close(worker->fd);