Skip to content

Handle MInput.MouseData.WheelDelta jumps when changing window focus or opening commands #1115

@SunsetQuasar

Description

@SunsetQuasar

I am planning on implementing this myself

No

Describe your request

MInput.MouseData.UpdateNull() gives its MouseStates their default values, that when updated normally via MInput.MouseData.Update() causes a large MInput.MouseData.WheelDelta as the actual polled mouse state scroll value will be very different from the previous default struct value.
I don't know the extent of removing the default value assignments entirely, but keeping the non-default scroll values around would fix this.

Additionally, while MInput does not update its input values when the window is unfocused or the commands menu is opened, the XNA/FNA side of things does. This allows the user to scroll the mousewheel with the game unfocused/commands opened, and only when switching back MInput.Update() runs, which may result in very different scroll values, i.e. a large MInput.MouseData.WheelDelta. Setting MouseData.PreviousState to MouseData.CurrentState when the window gains focus/commands are closed (before MInput.Update()) would fix the remaining issue.

These are slightly hacky solutions, but it's what I can think of.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions