From f8c1d0fb726407e79c65144dc0a5259ff0df4233 Mon Sep 17 00:00:00 2001 From: Delta456 Date: Tue, 24 Jun 2025 17:57:57 +0530 Subject: [PATCH 1/6] [py] add macOS specific keys to Key enum --- py/selenium/webdriver/common/keys.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/py/selenium/webdriver/common/keys.py b/py/selenium/webdriver/common/keys.py index c2e7e6e822e48..779d38d8f2cd3 100644 --- a/py/selenium/webdriver/common/keys.py +++ b/py/selenium/webdriver/common/keys.py @@ -88,3 +88,13 @@ class Keys: META = "\ue03d" COMMAND = "\ue03d" ZENKAKU_HANKAKU = "\ue040" + + # Extended macOS/ChromeDriver keys (based on observed Chrome usage) + RIGHT_SHIFT = "\ue050" + RIGHT_CONTROL = "\ue051" + RIGHT_ALT = "\ue052" + RIGHT_COMMAND = "\ue053" + + # Symbolic macOS keys not yet standardized + OPTIONS = "\uE050" # TODO: verify Unicode value with WebDriver spec + FUNCTION = "\uE051" # TODO: symbolic only; confirm or remove in future From 12199b6954bdd3a641652cf225ed95443705e401 Mon Sep 17 00:00:00 2001 From: Delta456 Date: Tue, 24 Jun 2025 18:39:39 +0530 Subject: [PATCH 2/6] lint --- py/selenium/webdriver/common/keys.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/selenium/webdriver/common/keys.py b/py/selenium/webdriver/common/keys.py index 779d38d8f2cd3..54835299558b8 100644 --- a/py/selenium/webdriver/common/keys.py +++ b/py/selenium/webdriver/common/keys.py @@ -96,5 +96,5 @@ class Keys: RIGHT_COMMAND = "\ue053" # Symbolic macOS keys not yet standardized - OPTIONS = "\uE050" # TODO: verify Unicode value with WebDriver spec - FUNCTION = "\uE051" # TODO: symbolic only; confirm or remove in future + OPTIONS = "\ue050" # TODO: verify Unicode value with WebDriver spec + FUNCTION = "\ue051" # TODO: symbolic only; confirm or remove in future From df20f90e77366b76878bf4550d75460252a02902 Mon Sep 17 00:00:00 2001 From: Delta456 Date: Tue, 24 Jun 2025 18:56:49 +0530 Subject: [PATCH 3/6] fmt --- py/selenium/webdriver/common/keys.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/selenium/webdriver/common/keys.py b/py/selenium/webdriver/common/keys.py index 54835299558b8..1398e0b0f3bb1 100644 --- a/py/selenium/webdriver/common/keys.py +++ b/py/selenium/webdriver/common/keys.py @@ -96,5 +96,5 @@ class Keys: RIGHT_COMMAND = "\ue053" # Symbolic macOS keys not yet standardized - OPTIONS = "\ue050" # TODO: verify Unicode value with WebDriver spec - FUNCTION = "\ue051" # TODO: symbolic only; confirm or remove in future + OPTIONS = "\ue050" # TODO: verify Unicode value with WebDriver spec + FUNCTION = "\ue051" # TODO: symbolic only; confirm or remove in future From b9437ccb98d73ffde4ec51ce4845e1bce68ecb6d Mon Sep 17 00:00:00 2001 From: Simon Benzer Date: Thu, 26 Jun 2025 11:16:35 -0400 Subject: [PATCH 4/6] tweaks --- py/selenium/webdriver/common/keys.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/py/selenium/webdriver/common/keys.py b/py/selenium/webdriver/common/keys.py index 1398e0b0f3bb1..6bf0de9cbdb24 100644 --- a/py/selenium/webdriver/common/keys.py +++ b/py/selenium/webdriver/common/keys.py @@ -31,10 +31,13 @@ class Keys: ENTER = "\ue007" SHIFT = "\ue008" LEFT_SHIFT = SHIFT + RIGHT_SHIFT = "\ue050" CONTROL = "\ue009" LEFT_CONTROL = CONTROL + RIGHT_CONTROL = "\ue051" ALT = "\ue00a" LEFT_ALT = ALT + RIGHT_ALT = "\ue052" PAUSE = "\ue00b" ESCAPE = "\ue00c" SPACE = "\ue00d" @@ -58,7 +61,7 @@ class Keys: NUMPAD0 = "\ue01a" # number pad keys NUMPAD1 = "\ue01b" NUMPAD2 = "\ue01c" - NUMPAD3 = "\ue01d" + NUMPAD3 = "x\ue01d" NUMPAD4 = "\ue01e" NUMPAD5 = "\ue01f" NUMPAD6 = "\ue020" @@ -86,15 +89,15 @@ class Keys: F12 = "\ue03c" META = "\ue03d" + LEFT_META = META + RIGHT_META = "\ue053" COMMAND = "\ue03d" + LEFT_COMMAND = COMMAND ZENKAKU_HANKAKU = "\ue040" - # Extended macOS/ChromeDriver keys (based on observed Chrome usage) - RIGHT_SHIFT = "\ue050" - RIGHT_CONTROL = "\ue051" - RIGHT_ALT = "\ue052" - RIGHT_COMMAND = "\ue053" - - # Symbolic macOS keys not yet standardized - OPTIONS = "\ue050" # TODO: verify Unicode value with WebDriver spec - FUNCTION = "\ue051" # TODO: symbolic only; confirm or remove in future + # Extended macOS keys + LEFT_OPTION = LEFT_ALT + RIGHT_OPTION = RIGHT_ALT + + + From d340acdf4eb4c39bced167b66c6272d2d5ab6464 Mon Sep 17 00:00:00 2001 From: Simon Benzer Date: Thu, 26 Jun 2025 11:18:03 -0400 Subject: [PATCH 5/6] tweaks --- py/selenium/webdriver/common/keys.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/py/selenium/webdriver/common/keys.py b/py/selenium/webdriver/common/keys.py index 6bf0de9cbdb24..858ad2983164a 100644 --- a/py/selenium/webdriver/common/keys.py +++ b/py/selenium/webdriver/common/keys.py @@ -61,7 +61,7 @@ class Keys: NUMPAD0 = "\ue01a" # number pad keys NUMPAD1 = "\ue01b" NUMPAD2 = "\ue01c" - NUMPAD3 = "x\ue01d" + NUMPAD3 = "\ue01d" NUMPAD4 = "\ue01e" NUMPAD5 = "\ue01f" NUMPAD6 = "\ue020" @@ -98,6 +98,4 @@ class Keys: # Extended macOS keys LEFT_OPTION = LEFT_ALT RIGHT_OPTION = RIGHT_ALT - - - + \ No newline at end of file From eaadcb51bcde12dc86f47b87a008bf94a2ac93ee Mon Sep 17 00:00:00 2001 From: Simon Benzer Date: Thu, 26 Jun 2025 11:19:43 -0400 Subject: [PATCH 6/6] linting --- py/selenium/webdriver/common/keys.py | 1 - 1 file changed, 1 deletion(-) diff --git a/py/selenium/webdriver/common/keys.py b/py/selenium/webdriver/common/keys.py index 858ad2983164a..8d2bf29c5e8d3 100644 --- a/py/selenium/webdriver/common/keys.py +++ b/py/selenium/webdriver/common/keys.py @@ -98,4 +98,3 @@ class Keys: # Extended macOS keys LEFT_OPTION = LEFT_ALT RIGHT_OPTION = RIGHT_ALT - \ No newline at end of file