I am doing a small project in avalonia in Win10 and I would like to be able to move my mouse with an event. Is that possible?
I’m asking because all I’ve seen with cursor interaction is SUBSCRIPTION to the cursor, or changing it’s appearance.
For now I’ve added this to a view to move the cursor:
[DllImport("user32.dll")]
static extern bool SetCursorPos(int x, int y);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool GetCursorPos(out System.Drawing.Point lpPoint);
But I’d rather have a more multiplatform-suitable option.
New contributor
Andrew Kovacs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.