Skip to content

[py] add macOS specific keys to Key enum #15948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions py/selenium/webdriver/common/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -86,5 +89,12 @@ class Keys:
F12 = "\ue03c"

META = "\ue03d"
LEFT_META = META
RIGHT_META = "\ue053"
COMMAND = "\ue03d"
LEFT_COMMAND = COMMAND
ZENKAKU_HANKAKU = "\ue040"

# Extended macOS keys
LEFT_OPTION = LEFT_ALT
RIGHT_OPTION = RIGHT_ALT