mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 01:35:32 +00:00
Fix duplicate scroll input on windows 10
This commit is contained in:
parent
f8ac2565fa
commit
9ef456bf9a
|
@ -97,6 +97,9 @@ namespace OpenTK.Platform.Windows
|
||||||
IntPtr cursor_handle = Functions.LoadCursor(CursorName.Arrow);
|
IntPtr cursor_handle = Functions.LoadCursor(CursorName.Arrow);
|
||||||
int cursor_visible_count = 0;
|
int cursor_visible_count = 0;
|
||||||
|
|
||||||
|
// tracking for w10 duplicate scroll inputs.
|
||||||
|
IntPtr scrollHandle;
|
||||||
|
|
||||||
static readonly object SyncRoot = new object();
|
static readonly object SyncRoot = new object();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -534,8 +537,13 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
// This is due to inconsistent behavior of the WParam value on 64bit arch, whese
|
// This is due to inconsistent behavior of the WParam value on 64bit arch, whese
|
||||||
// wparam = 0xffffffffff880000 or wparam = 0x00000000ff100000
|
// wparam = 0xffffffffff880000 or wparam = 0x00000000ff100000
|
||||||
|
if (scrollHandle == IntPtr.Zero) {
|
||||||
|
scrollHandle = handle;
|
||||||
|
}
|
||||||
|
if (handle == scrollHandle) {
|
||||||
OnMouseWheel(0, ((long)wParam << 32 >> 48) / 120.0f);
|
OnMouseWheel(0, ((long)wParam << 32 >> 48) / 120.0f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void HandleMouseHWheel(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
|
void HandleMouseHWheel(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue