From ed08f068c7795539d1baf7f3928e1f29d0a66d69 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Fri, 26 Nov 2010 11:00:57 +0000 Subject: [PATCH] * Platform/MacOS/CarbonBindings/QuartzDisplayServicesAPI.cs: Added support for mouse control. --- .../CarbonBindings/QuartzDisplayServicesAPI.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Source/OpenTK/Platform/MacOS/CarbonBindings/QuartzDisplayServicesAPI.cs b/Source/OpenTK/Platform/MacOS/CarbonBindings/QuartzDisplayServicesAPI.cs index f15d1a20..c30c8399 100644 --- a/Source/OpenTK/Platform/MacOS/CarbonBindings/QuartzDisplayServicesAPI.cs +++ b/Source/OpenTK/Platform/MacOS/CarbonBindings/QuartzDisplayServicesAPI.cs @@ -5,6 +5,8 @@ using System.Diagnostics; namespace OpenTK.Platform.MacOS.Carbon { + using CGDirectDisplayID = System.IntPtr; + // Quartz Display services used here are available in MacOS X 10.3 and later. enum CGDisplayErr @@ -67,5 +69,20 @@ namespace OpenTK.Platform.MacOS.Carbon [DllImport(appServices, EntryPoint = "CGWarpMouseCursorPosition")] internal static extern CGError WarpMouseCursorPosition(HIPoint newCursorPosition); + + [DllImport(appServices, EntryPoint = "CGCursorIsVisible")] + internal static extern bool CursorIsVisible(); + + [DllImport(appServices, EntryPoint = "CGDisplayShowCursor")] + internal static extern CGError DisplayShowCursor(CGDirectDisplayID display); + + [DllImport(appServices, EntryPoint = "CGDisplayHideCursor")] + internal static extern CGError DisplayHideCursor(CGDirectDisplayID display); + + [DllImport(appServices, EntryPoint = "CGAssociateMouseAndMouseCursorPosition")] + internal static extern CGError AssociateMouseAndMouseCursorPosition(bool connected); + + [DllImport(appServices, EntryPoint="CGSetLocalEventsSuppressionInterval")] + internal static extern CGError SetLocalEventsSuppressionInterval(double seconds); } }