From 59291a27f9349425be6397c402bd35d021dedffb Mon Sep 17 00:00:00 2001
From: Ray-V <ray-v@inbox.lv>
Date: Fri, 16 Apr 2021 13:55:39 +0100
Subject: Add toggle for AltGr alpha characters key display when Caps is on

Signed-off-by: Ray-V <ray-v@inbox.lv>
(cherry picked from commit 907f3d61aa5cefc1d3768535ef8b9d2ba6d73007)
---
 src/VButton.cpp | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/VButton.cpp b/src/VButton.cpp
index 95d31e2..c0ce411 100644
--- a/src/VButton.cpp
+++ b/src/VButton.cpp
@@ -91,8 +91,19 @@ void VButton::shiftCapsAltGrPressed(bool shift, bool caps, bool altGrState)
 {
 	if (altGrState)
 	{
-		// Caps does not seem to make any difference when AltGr is pressed
-		if (shift)
+		// If Caps is on, displayed alpha characters should be toggled from the AltGr case
+		if (caps)
+		{
+			if (shift)
+			{
+				TQPushButton::setText(altGrShiftText.lower());
+			}
+			else
+			{
+				TQPushButton::setText(altGrText.upper());
+			}
+		}
+		else if (shift)
 		{
 			TQPushButton::setText(altGrShiftText);
 		}
-- 
cgit v1.2.1