Closed skotekar closed 2 years ago
I would like to add that, by explicitly casting the negative value to an uint, it does work as expected, so may not be a bug but a nice to have may be?
Ya, the use of DWORD
in the header and the docs conflicts with the expectation of negative values, isn't it?
I think we can special case this in the metadata.
@AArnott This from win32metadata 23.0.3.6210 See #876
// Windows.Win32.UI.Input.KeyboardAndMouse.MOUSEINPUT
using System;
using Windows.Win32.UI.Input.KeyboardAndMouse;
public struct MOUSEINPUT
{
public int dx;
public int dy;
public int mouseData;
public MOUSE_EVENT_FLAGS dwFlags;
public uint time;
public UIntPtr dwExtraInfo;
}
Duplicate of #876
Actual behavior
Type for mouseData field inside MOUSEINPUT structure is created as a uint.
Expected behavior
According to the documentation (https://docs.microsoft.com/windows/win32/api//winuser/ns-winuser-mouseinput#members), we should be able to specify both positive and negative values to simulate forward or backward rotation of the wheel.
Repro steps
NativeMethods.txt
content:Any of your own code that should be shared? Below is the code generated for MOUSEINPUT structure in my project. Check the type for mouseData field
Context
0.1.647-beta
]net6.0-windows
]