From 56708111e242950793983345b4a5fb8f443e9812 Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Thu, 26 Jun 2025 00:50:53 +0700 Subject: [PATCH 1/2] Add representations for right modifier keys in Keys class --- dotnet/src/webdriver/Keys.cs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/dotnet/src/webdriver/Keys.cs b/dotnet/src/webdriver/Keys.cs index b8e2ca9422b55..23af87ff074f3 100644 --- a/dotnet/src/webdriver/Keys.cs +++ b/dotnet/src/webdriver/Keys.cs @@ -352,6 +352,36 @@ public static class Keys /// public static readonly string ZenkakuHankaku = Convert.ToString(Convert.ToChar(0xE040, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + /// + /// Represents the right Shift key. + /// + public static readonly string RightShift = Convert.ToString(Convert.ToChar(0xE050, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + + /// + /// Represents the right Control key. + /// + public static readonly string RightControl = Convert.ToString(Convert.ToChar(0xE051, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + + /// + /// Represents the right Alt key. + /// + public static readonly string RightAlt = Convert.ToString(Convert.ToChar(0xE052, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + + /// + /// Represents the right Command key (macOS). + /// + public static readonly string RightCommand = Convert.ToString(Convert.ToChar(0xE053, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + + /// + /// Represents the macOS Options key (same Unicode value as RightShift). + /// + public static readonly string Options = Convert.ToString(Convert.ToChar(0xE050, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + + /// + /// Represents the macOS Function key (same Unicode value as RightControl). + /// + public static readonly string Function = Convert.ToString(Convert.ToChar(0xE051, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + private static Dictionary? descriptions; /// @@ -422,6 +452,12 @@ internal static object GetDescription(string value) descriptions.Add(Meta, "Meta"); descriptions.Add(Command, "Command"); descriptions.Add(ZenkakuHankaku, "Zenkaku Hankaku"); + descriptions.Add(RightShift, "Right Shift"); + descriptions.Add(RightControl, "Right Control"); + descriptions.Add(RightAlt, "Right Alt"); + descriptions.Add(RightCommand, "Right Command"); + descriptions.Add(Options, "Options"); + descriptions.Add(Function, "Function"); } if (descriptions.TryGetValue(value, out string? description)) From 4ea75e5970932d720efd0a8f4e0da0ebefdb4211 Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Thu, 26 Jun 2025 12:55:43 +0700 Subject: [PATCH 2/2] Fix macOS Options key representation in Keys class --- dotnet/src/webdriver/Keys.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/src/webdriver/Keys.cs b/dotnet/src/webdriver/Keys.cs index 23af87ff074f3..369c3c8b1d07c 100644 --- a/dotnet/src/webdriver/Keys.cs +++ b/dotnet/src/webdriver/Keys.cs @@ -375,7 +375,7 @@ public static class Keys /// /// Represents the macOS Options key (same Unicode value as RightShift). /// - public static readonly string Options = Convert.ToString(Convert.ToChar(0xE050, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + public static readonly string Options = Convert.ToString(Convert.ToChar(0xE052, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); /// /// Represents the macOS Function key (same Unicode value as RightControl).