Open
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR converts the top-level mouse button constants into an enum, updating type annotations and documentation accordingly while removing unused constant exports.
- Updated JSDoc annotations for functions in the mouse API to reference the new MouseButton enum.
- Removed the legacy MOUSEBUTTON_* constants from constants.js and replaced them with enum values in the appropriate modules.
- Adjusted the index and deprecated exports to accommodate the new enum structure.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/platform/input/mouse.js | Updated JSDoc type annotations and added an import comment for MouseButton. |
| src/platform/input/mouse-event.js | Changed type annotations and initialized the button property with MouseButton.NONE. |
| src/platform/input/controller.js | Revised documentation to reference the new enum (pc.MouseButton.LEFT, etc.). |
| src/platform/input/constants.js | Removed legacy mouse constants in favor of the enum. |
| src/index.js | Exported the new MouseButton enum for external use. |
| src/deprecated/deprecated.js | Updated deprecated constants to reference the new enum values. |
Comments suppressed due to low confidence (1)
src/deprecated/deprecated.js:776
- [nitpick] There is an inconsistency in enum property casing: the new documentation in other parts of the code references pc.MouseButton.LEFT (all uppercase) whereas this export uses MouseButton.Left. Consider standardizing the enum property names to ensure consistency across the codebase.
export const MOUSEBUTTON_LEFT = MouseButton.Left;
kungfooman
reviewed
Apr 29, 2025
Collaborator
|
Please read: #7589 (comment) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #7589
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.