You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds the missing macOS-specific symbolic keys OPTION and FN to the Keys enum in py/selenium/webdriver/common/keys. These keys are part of the macOS keyboard layout but were not previously represented in the enum.
🔧 Implementation Notes
Adds keys to the enum
💡 Additional Considerations
🔄 Types of changes
New feature (non-breaking change which adds functionality and tests!)
PR Type
Enhancement
Description
Add macOS-specific keys OPTIONS and FUNCTION to Python Keys enum
Include extended macOS/ChromeDriver keys for right-side modifiers
Add Unicode values for macOS keyboard layout compatibility
Changes walkthrough 📝
Relevant files
Enhancement
keys.py
Add macOS-specific keyboard keys to enum
py/selenium/webdriver/common/keys.py
Add OPTIONS and FUNCTION keys for macOS symbolic keys
The OPTIONS and FUNCTION keys use Unicode values that conflict with RIGHT_SHIFT and RIGHT_CONTROL. OPTIONS uses \uE050 which is the same as RIGHT_SHIFT, and FUNCTION uses \uE051 which is the same as RIGHT_CONTROL. This will cause key conflicts.
OPTIONS="\uE050"# TODO: verify Unicode value with WebDriver specFUNCTION="\uE051"# TODO: symbolic only; confirm or remove in future
The TODO comments indicate that Unicode values for OPTIONS and FUNCTION keys are unverified and may need to be confirmed or removed. This suggests the implementation is incomplete and may not work correctly.
OPTIONS="\uE050"# TODO: verify Unicode value with WebDriver specFUNCTION="\uE051"# TODO: symbolic only; confirm or remove in future
✅ Fix duplicate Unicode key mappingsSuggestion Impact:The suggestion identified a critical issue with duplicate Unicode mappings. Instead of implementing the exact fix suggested, the commit resolved the conflict by completely removing the problematic OPTIONS and FUNCTION keys and reorganizing the code structure
code diff:
- # 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
The OPTIONS and FUNCTION keys use Unicode values that conflict with the right-side modifier keys defined above. This creates duplicate Unicode mappings which could cause unexpected behavior when these keys are used.
-OPTIONS = "\uE050" # TODO: verify Unicode value with WebDriver spec-FUNCTION = "\uE051" # TODO: symbolic only; confirm or remove in future+OPTIONS = "\uE054" # TODO: verify Unicode value with WebDriver spec+FUNCTION = "\uE055" # TODO: symbolic only; confirm or remove in future
[Suggestion processed]
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies that the Unicode values for OPTIONS (\uE050) and FUNCTION (\uE051) conflict with the newly added RIGHT_SHIFT (\ue050) and RIGHT_CONTROL (\ue051). This duplication could cause unexpected behavior and is a critical issue to fix. The proposed change resolves this conflict.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
🔗 Related Issues
#15945 but for Python
💥 What does this PR do?
This PR adds the missing macOS-specific symbolic keys
OPTIONandFNto the Keys enum inpy/selenium/webdriver/common/keys. These keys are part of the macOS keyboard layout but were not previously represented in the enum.🔧 Implementation Notes
Adds keys to the enum
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add macOS-specific keys
OPTIONSandFUNCTIONto Python Keys enumInclude extended macOS/ChromeDriver keys for right-side modifiers
Add Unicode values for macOS keyboard layout compatibility
Changes walkthrough 📝
keys.py
Add macOS-specific keyboard keys to enumpy/selenium/webdriver/common/keys.py
OPTIONSandFUNCTIONkeys for macOS symbolic keysRIGHT_SHIFT,RIGHT_CONTROL,RIGHT_ALT,RIGHT_COMMAND)