[Win32] Implemented Mouse.SetPosition via SetCursorPos. This was refreshingly simple, the function works exactly as expected! (unlike XWarpPointer on X11)

This commit is contained in:
the_fiddler 2010-11-23 22:10:49 +00:00
parent 23eaef0c70
commit 1d33d1000e
3 changed files with 5 additions and 2 deletions

View file

@ -971,6 +971,9 @@ namespace OpenTK.Platform.Windows
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern bool ClipCursor(IntPtr rcClip);
[DllImport("user32.dll")]
public static extern bool SetCursorPos(int X, int Y);
#region Async input
#region GetCursorPos

View file

@ -139,7 +139,7 @@ namespace OpenTK.Platform.Windows
public void SetPosition(double x, double y)
{
throw new NotImplementedException();
Functions.SetCursorPos((int)x, (int)y);
}
#endregion

View file

@ -280,7 +280,7 @@ namespace OpenTK.Platform.Windows
public void SetPosition(double x, double y)
{
throw new NotImplementedException();
Functions.SetCursorPos((int)x, (int)y);
}
#endregion