diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index 96c3de9f..97b4115b 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -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 diff --git a/Source/OpenTK/Platform/Windows/WMInput.cs b/Source/OpenTK/Platform/Windows/WMInput.cs index 692ef491..e512204f 100644 --- a/Source/OpenTK/Platform/Windows/WMInput.cs +++ b/Source/OpenTK/Platform/Windows/WMInput.cs @@ -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 diff --git a/Source/OpenTK/Platform/Windows/WinRawMouse.cs b/Source/OpenTK/Platform/Windows/WinRawMouse.cs index 4d6ade4f..38e8a371 100644 --- a/Source/OpenTK/Platform/Windows/WinRawMouse.cs +++ b/Source/OpenTK/Platform/Windows/WinRawMouse.cs @@ -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