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

Fix mouse scroll for key mapping #12110

Merged
merged 1 commit into from
Jun 18, 2019
Merged

Conversation

LunaMoo
Copy link
Collaborator

@LunaMoo LunaMoo commented Jun 16, 2019

Fixes #11043 (which I totally forgot about;p ~ sorries)

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Jun 17, 2019

Please don't merge yet, it causes some weird wheel interaction in UI;c, I guess it needs that fix has to be limited to in-game similar to how mouse movement is.

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Jun 17, 2019

Heh, I think it's still bad overall, going to have to think about it more as it can get stuck.
Does WM_MOUSEWHEEL is only called when a wheel event is passed? Or maybe something related to #11226

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Jun 17, 2019

As far as I tested this works fine now althrough may be a bit hacky. I set a variable in WM_MOUSEWHEEL event when wheel is "key_down" and check for that variable under default case to send "key_up".

Moved WM_MOUSEWHEEL to DisplayProc as well, dunno what "some reason" was forcing it in WndProc, but works fine nowadays in DisplayProc.

If this solution is acceptable I can squash the commits later.

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Jun 17, 2019

Heh I squashed, but it still sucks I need to release it elsewhere, default case in DisplayProc still requires some event to trigger I guess.

Also moved WM_MOUSEWHEEL to DisplayProc where it works fine now.
@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Jun 18, 2019

Ended up using a timer using 16ms delay to ensure wheel is released on next frame even in 60 fps games. I think it's ready now.:]

@hrydgard
Copy link
Owner

Yeah, I suppose that'll be alright...

@hrydgard hrydgard added this to the v1.9.0 milestone Jun 18, 2019
@hrydgard hrydgard added the Input/Controller Input and controller issues label Jun 18, 2019
@hrydgard hrydgard merged commit 53e8263 into hrydgard:master Jun 18, 2019
@LunaMoo LunaMoo deleted the FixMouseScroll branch June 19, 2019 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Input/Controller Input and controller issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mouse scroll doesn't work when mapped via mouse control
2 participants