beyond-all-reason / beyond-all-reason/RecoilEngine

[Feature] Lock/Unlock Mouse Position

Open
#654 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

Afaik, currently we have no feature that allows locking/unlocking mouse position for things like free camera rotation and gui control objects like boundless sliders. The variety of such operations and needs for controls are so that it's the best to have a dedicated function to control that behaviour, not tied to Spring's hotkey system. I assume, this would approve existing COFC code as well, that uses a workaround which I tested to be imperfect in terms of accuracy for a case of low FPS (a workaround including WarpMouse to make the cursor stay still, apparently is the reason of a non-negligible inaccuracy in my tests).
The proposition is to add 2 functions:
- LockMousePosition(locked)
- GetLastUpdateMouseMovement() -> dx,dy

All in all, this would save from quite cumbersome code with the mouse warps forth and back, as well as give an accurate behaviour.

P.S. _Potentially I may come up with a PR myself in a few months (no good window to take on engine work for now)._

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing COFC mouse-position workaround and its uses of WarpMouse, then review how mouse movement is exposed by the engine. Done means providing dedicated lock/unlock behavior and accurate last-update movement values without relying on the hotkey system or repeated warps; validate behavior under low FPS as described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.