SDL: riscos: Report keyboard repeat events

From 98353533e51e2ea90768c9c43f1d08296cd434f7 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <[EMAIL REDACTED]>
Date: Wed, 23 Feb 2022 18:54:31 +0000
Subject: [PATCH] riscos: Report keyboard repeat events

---
 src/video/riscos/SDL_riscosevents.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/src/video/riscos/SDL_riscosevents.c b/src/video/riscos/SDL_riscosevents.c
index b7ae62e9e76..b0a0d750915 100644
--- a/src/video/riscos/SDL_riscosevents.c
+++ b/src/video/riscos/SDL_riscosevents.c
@@ -67,7 +67,6 @@ RISCOS_PollKeyboard(_THIS)
 
     /* Check for key presses */
     while (key < 0xff) {
-        SDL_bool already_pressed = SDL_FALSE;
         key = _kernel_osbyte(121, key + 1, 0) & 0xff;
         switch (key) {
         case 255:
@@ -83,22 +82,16 @@ RISCOS_PollKeyboard(_THIS)
             break;
 
         default:
-            /* Do we already know of this key? */
+            SDL_SendKeyboardKey(SDL_PRESSED, SDL_RISCOS_translate_keycode(key));
+
+            /* Record the press so we can detect release later. */
             for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) {
                 if (driverdata->key_pressed[i] == key) {
-                    already_pressed = SDL_TRUE;
                     break;
                 }
-            }
-
-            if (!already_pressed) {
-                SDL_SendKeyboardKey(SDL_PRESSED, SDL_RISCOS_translate_keycode(key));
-                /* Record the press so we can detect release later. */
-                for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) {
-                    if (driverdata->key_pressed[i] == 255) {
-                        driverdata->key_pressed[i] = key;
-                        break;
-                    }
+                if (driverdata->key_pressed[i] == 255) {
+                    driverdata->key_pressed[i] = key;
+                    break;
                 }
             }
         }