Add move_mouse_to_point usage example for input API#765
Open
abdullah12121212 wants to merge 2 commits into
Open
Add move_mouse_to_point usage example for input API#765abdullah12121212 wants to merge 2 commits into
abdullah12121212 wants to merge 2 commits into
Conversation
❌ Deploy Preview for splashkit failed.
|
23 tasks
jankiluitel
suggested changes
May 13, 2026
jankiluitel
left a comment
There was a problem hiding this comment.
Overall, it looks good; the example is interactive, understandable, and successfully illustrates the mouse movement API in all supported languages. Users trying the example can easily understand the behaviour thanks to the visual target markers and keyboard mappings.
Before approving, a few minor recommendations:
- There is a little discrepancy in the name between languages (
MoveMousein C#/C++ vs.move_mouse_to_pointin Python). Aligning comments and explanations more closely with the names of the actual API functions being demonstrated should be beneficial. - For somewhat improved first-time usability, think about including a brief instruction line near the top, such as "Press Q/E/A/D/SPACE to teleport the cursor."
- To provide consistency in readability across files, some draw_text calls' spacing and alignment might be standardised.* GIF preview enhances the quality of the documentation and is a welcome feature.
Overall, this is a solid contribution and ready for final review after minor polish.
222448082Ashen
approved these changes
May 13, 2026
222448082Ashen
left a comment
There was a problem hiding this comment.
Peer Review
I've reviewed the move_mouse_to_point usage example.
Checks
- All required files are present.
- Example Title (.txt) move_mouse_to_point-1-example.txt
- C++ code: move_mouse_to_point-1-example.cpp
- C# code (top-level statements) move_mouse_to_point-1-example-top-level.cs
- C# code (Object-Oriented Programming) move_mouse_to_point-1-example-oop.cs
- Python code move_mouse_to_point-1-example.py
- Code correctly uses SplashKit functions (verified against API documentation).
- Code clearly demonstrates the function with interactive target points.
- All versions maintain the same structure and comments.
Code Tests done
- C++ code: Syntax verified (uses correct move_mouse(point_2d) overload)
- C# top level code: Syntax verified (uses correct MoveMouse(Point2D) overload)
- C# OOP code: Syntax verified (uses correct MoveMouse(Point2D) overload)
- Python code: Syntax verified (uses correct move_mouse_to_point(point) function)
Website Tests done
- npm run build
- npm run preview
- Usage example scraped correctly into usage-example-references.json
- Clarify function name discrepancy in comments: note that move_mouse in C++ and MoveMouse in C# are the equivalents of move_mouse_to_point - Update instruction text to explicitly list keys (Q/E/A/D/SPACE) so users know the controls at a glance - Fix extra whitespace in center point's fill_circle and draw_text calls to match the column alignment of the other four target points
abdullah12121212
pushed a commit
to abdullah12121212/splashkit.io-starlight
that referenced
this pull request
May 13, 2026
- Rebased out the move_mouse_to_point commit (those files belong to PR thoth-tech#765) - Changed window title from 'Timer Started' to 'Start-Stop Stopwatch' to match the descriptive name in the .txt file, as suggested by reviewer
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.
Description
Please include a summary of the changes and the related issue. Please also include relevant
motivation and context. List any dependencies that are required for this change.
This pull request adds usage examples for the move_mouse_to_point function in the SplashKit input API. The examples demonstrate how to use move_mouse_to_point (and its C# equivalent MoveMouse) to reposition the mouse cursor to specified point_2d locations on the window. Each example creates five target points (four corners and the center of the window) and lets the user press different keys to snap the mouse to those points. Colored circles and text labels are drawn at each target, so the behavior of the function is easy to see visually.
The examples are provided in C++, Python, and C# (both top-level and OOP styles), along with a demo GIF showing the output. This contribution is part of the ongoing capstone work to add usage examples for SplashKit input API functions.
Type of change
Please delete options that are not relevant.
expected)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can
reproduce. Please also list any relevant details for your test configuration.
I tested each example locally by compiling and running it with SplashKit installed on my machine. For each language version I opened the window, pressed the Q, E, A, D, and SPACE keys, and confirmed that the mouse cursor moved to the correct target point each time. I also confirmed the labels and coloured circles render in the right positions, and the demo GIF was recorded from the working C++ build.
Testing Checklist
Checklist
Please delete options that are not relevant.
If involving code
If modified config files
Folders and Files Added/Modified
Please list the folders and files added/modified with this pull request and delete options that are not relevant.
Additional Notes
Please add any additional information that might be useful for the reviewers.