SDL-1.2: atari: handle also shift released state

From d5088e5db1bcf174f53379d543ff49093a9d6d72 Mon Sep 17 00:00:00 2001
From: Miro Kropacek <[EMAIL REDACTED]>
Date: Fri, 8 Dec 2023 23:14:55 +0100
Subject: [PATCH] atari: handle also shift released state

Commit 0b2be4c9 wasn't enough, even the released states need to be handled explicitly.

Contributed by Thorsten Otto.
---
 src/video/ataricommon/SDL_biosevents.c   | 2 +-
 src/video/ataricommon/SDL_gemdosevents.c | 2 +-
 src/video/ataricommon/SDL_ikbdevents.c   | 2 +-
 src/video/gem/SDL_gemevents.c            | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/video/ataricommon/SDL_biosevents.c b/src/video/ataricommon/SDL_biosevents.c
index c55966dc..c90b8a27 100644
--- a/src/video/ataricommon/SDL_biosevents.c
+++ b/src/video/ataricommon/SDL_biosevents.c
@@ -97,7 +97,7 @@ void AtariBios_PumpEvents(_THIS)
 		/* Key unpressed ? */
 		if (bios_previouskeyboard[i] && !bios_currentkeyboard[i])
 			SDL_PrivateKeyboard(SDL_RELEASED,
-				SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE, 0));
+				SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE, kstate));
 	}
 
 	if (use_dev_mouse) {
diff --git a/src/video/ataricommon/SDL_gemdosevents.c b/src/video/ataricommon/SDL_gemdosevents.c
index a510e480..8d708501 100644
--- a/src/video/ataricommon/SDL_gemdosevents.c
+++ b/src/video/ataricommon/SDL_gemdosevents.c
@@ -98,7 +98,7 @@ void AtariGemdos_PumpEvents(_THIS)
 		/* Key unpressed ? */
 		if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i])
 			SDL_PrivateKeyboard(SDL_RELEASED,
-				SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE, 0));
+				SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE, kstate));
 	}
 
 	if (use_dev_mouse) {
diff --git a/src/video/ataricommon/SDL_ikbdevents.c b/src/video/ataricommon/SDL_ikbdevents.c
index 560c6ef1..c9436199 100644
--- a/src/video/ataricommon/SDL_ikbdevents.c
+++ b/src/video/ataricommon/SDL_ikbdevents.c
@@ -104,7 +104,7 @@ void AtariIkbd_PumpEvents(_THIS)
 		/* Key released ? */
 		if (SDL_AtariIkbd_keyboard[i]==KEY_RELEASED) {
 			SDL_PrivateKeyboard(SDL_RELEASED,
-				SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE, 0));
+				SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE, AtariIkbd_Shiftstate()));
 			SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
 		}
 	}
diff --git a/src/video/gem/SDL_gemevents.c b/src/video/gem/SDL_gemevents.c
index 3b90541e..f8a26765 100644
--- a/src/video/gem/SDL_gemevents.c
+++ b/src/video/gem/SDL_gemevents.c
@@ -165,7 +165,7 @@ void GEM_PumpEvents(_THIS)
 		/* Key unpressed ? */
 		if (gem_previouskeyboard[i] && !gem_currentkeyboard[i])
 			SDL_PrivateKeyboard(SDL_RELEASED,
-				SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE, 0));
+				SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE, kstate));
 	}
 
 	SDL_memcpy(gem_previouskeyboard,gem_currentkeyboard,sizeof(gem_previouskeyboard));