Skip to content

Conversation

@ellzie
Copy link
Contributor

@ellzie ellzie commented Nov 10, 2025

Adds a console command sar_sensitivity <cm/in> <distance> <dpi> that allows users to enter either a inches/360 or a centimeters/360 value along with their dpi to change their sens to the sens that makes that distance/360 value. Requested by issue #312, some users are more familiar with the distance/360 that they play at or would like to make adjustments using distance/360. This also helps users coming from other games that may not use the source sensitivity system.

With m_rawinput 1 this feature trivially calculates the sensitivity required, and with m_rawinput 0 (*on windows) will consider their windows sensitivity settings to create a sensitivity that will make the distance/360. While windows mouse acceleration defeats the purpose of a set distance/360, it is still considered in calculating the required sensitivity.

Unfortunately operating system sensitivity settings cannot be easily obtained on Linux, so any usage of the command with m_rawinput 0 will have a chance of being inaccurate if mouse acceleration or sensitivity is changed in OS.

This is being submitted as a draft for two reasons: first being that I do not have access to Portal 2 on Linux so I need someone to make sure that the windows only carve outs actually work, secondly there is still the need to consider if m_customaccel settings need to be considered when setting a distance/360. Currently my understanding is that it is not possible because m_customaccel works directly with the raw mouse movement delta, and no amount of changing the sensitivity is going to be able to make the mouse speed actually conform to your distance/360 (doing help m_customaccel in game shows the formulas used, which directly change the delta first then add the sensitivity), but I don't know for sure.

On a final note I left my comments to help with my understanding but they can be removed.

@ThisAMJ ThisAMJ linked an issue Dec 6, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sar_sensitivity <cm/360>

1 participant