Scale relative cursor speed if client and server resolutions differ #142
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.
Reference the issue numbers and reviewers
#98 @ehfd
Explain relevant issues and how this pull request solves them
This pull request fixes the issue #98 by implementing the a scaling technique to change the cursor speeds.
Describe the changes in code and its dependencies and justify that they work as intended after testing
The changes revolve around detecting if client and server are having different resolutions, if so, we'd introduce the cursorScalingFactor which is then be used to scale the relative cursor speeds by multiplying the relative cursor position (x and y values) with the scalingFactor before sending to server. Thus based on the scaling factor the speed could either increase or decrease to provide smooth user experience.
Describe alternatives you've considered
NA
Additional context
![Screenshot from 2024-04-17 17-07-47](https://private-user-images.githubusercontent.com/57227290/323231955-8e2e93ab-ff89-4bc4-8b77-f53681823c20.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyMTU0MzMsIm5iZiI6MTcyMDIxNTEzMywicGF0aCI6Ii81NzIyNzI5MC8zMjMyMzE5NTUtOGUyZTkzYWItZmY4OS00YmM0LThiNzctZjUzNjgxODIzYzIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA1VDIxMzIxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY0OTlhZTQ2Y2Q4YzE2MWVlYmY0MzU3NTgzNjhkYWJkMGM0YzJmODdlMGViOTdlYWFkYzdmMWNlODg5YWFkMDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.WmDCTsaQWnxYTVMvujeETmVlcmnLQiaZKDLU4NZ6ZpY)
The code includes a check if the client resolution is the range of delta 10, this is done due to the reason that sometimes the video and window resolution doesn't match quite exactly.