Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Shared] Add cl_mouseAspectScaling to correct UI mouse sensitivity for your resolution #1170

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Razish
Copy link
Member

@Razish Razish commented Sep 25, 2023

With this enabled, the cursor moves about the same rate as my desktop cursor.
Without this, horizontal movement is too sensitive on e.g. 1920x1080 windowed.

It's optional behind a cvar because without a breaking API change[1] or a more complex solution[2], small (sub-pixel) movements are completely discarded by being truncated.
It may have also already been fixed by a mod[3], so we don't want to scale it twice.

[1] int -> float for UI_MOUSE_EVENT / CG_MOUSE_EVENT
[2] e.g. floating point accumulation buffer that emits movement events when it exceeds a whole number
[3] ja++ equivalent fix in ui/ui_main.cpp

@Razish Razish requested a review from a team September 25, 2023 13:19
Copy link

@bartrpe bartrpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I had it tested across various things:

  • two merged 1920x1080 screens (essentially 3840x1080... I should one day get to try to list all the various bugs that happen at this ultra wide level)
  • one 1920x1080
  • tested every resolution set that's preset at r_mode options
  • tested on 3840 x 2160 TV
  • tested on old 1280x1024 screen

did that with various mouses too because why not

no bugs found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants