From 96791683d0326c6c8f8d7ec9b92673681637856f Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Fri, 26 Nov 2010 11:00:27 +0000 Subject: [PATCH] * Platform/MacOS/CarbonBindings/CarbonAPI.cs: Added support for mouse delta events. --- .../Platform/MacOS/CarbonBindings/CarbonAPI.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Source/OpenTK/Platform/MacOS/CarbonBindings/CarbonAPI.cs b/Source/OpenTK/Platform/MacOS/CarbonBindings/CarbonAPI.cs index 45975680..593612d0 100644 --- a/Source/OpenTK/Platform/MacOS/CarbonBindings/CarbonAPI.cs +++ b/Source/OpenTK/Platform/MacOS/CarbonBindings/CarbonAPI.cs @@ -714,17 +714,31 @@ namespace OpenTK.Platform.MacOS.Carbon unsafe { HIPoint* parm = &point; - OSStatus result = API.GetEventParameter(inEvent, EventParamName.WindowMouseLocation, EventParamType.typeHIPoint, IntPtr.Zero, (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(HIPoint)), IntPtr.Zero, (IntPtr)parm); - pt = point; return result; } + } + static internal OSStatus GetEventMouseDelta(IntPtr inEvent, out HIPoint pt) + { + HIPoint point; + + unsafe + { + HIPoint* parm = &point; + OSStatus result = API.GetEventParameter(inEvent, + EventParamName.MouseDelta, EventParamType.typeHIPoint, IntPtr.Zero, + (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(HIPoint)), IntPtr.Zero, + (IntPtr)parm); + pt = point; + + return result; + } } static internal OSStatus GetEventWindowRef(IntPtr inEvent, out IntPtr windowRef)