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

Raw Input Flickering Fix | Issue #177 #186

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

L3D451R7
Copy link
Contributor

@L3D451R7 L3D451R7 commented Dec 23, 2024

reworked IN_RecenterMouse, Improved focus checks for Raw Input, fixed Raw Input bugs caused by mouse reaching edges of application window rect (#177), also removed useless WM_MOUSEFIRST window message callback.

…ouse actually returns result of SetCursorPos which is BOOL.
auto recenterMouse = Game::CL_MouseEvent(curPos.x, curPos.y, dx, dy);

ClipCursor(NULL);
if (!Game::CL_MouseEvent(curPos.x, curPos.y, dx, dy))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why check CL_MouseEvent to disable clipping? ClipCursor(NULL) was originally used to prevent clipping in the menu. Does CL_MouseEvent return false in menus and true otherwise?

If so, we should add a comment to clarify. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It returns true when it wants mouse to be recentered.

@Rackover
Copy link
Contributor

Rackover commented Jan 2, 2025

I see no obvious issue with the code, the get<dvar_t*> thingies are a bit odd but I don't mind them.
Testing it, I cannot reproduce the bug, and the gamepad seems to work gracefully. although, I cannot perceive a difference between m_rawInput 1 and m_rawInput 0 anymore (it used to feel really different, now it doesn't)

Confirm to me that everything is working as intended?
If so, I'm ready to merge this as I see no glaring undesirable side effect compared to master, so I'm ready to trust you it's a change for the better 🙂

@wroyca
Copy link
Collaborator

wroyca commented Jan 7, 2025

Hello! Here are some issues I noticed during my test:

The cursor takes too long to clip back when focus is lost and regained. This delay often cause the cursor to escape the window accidentally while aiming:

Screencast.From.2025-01-07.15-05-45.mp4

The cursor moves in the background, meaning its position is not fixed. It appears in different positions when switching back and forth between the menu and the game. Occasionally, the cursor position is recalculated, leading to erratic jumps within the menu (0:16s):

Screencast.From.2025-01-07.15-09-29.mp4

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.

3 participants