Added GetMouseEventLocation Carbon wrapper function.

This commit is contained in:
kanato 2009-02-05 04:36:17 +00:00
parent 4f4dd33c13
commit dc6f0e6461

View file

@ -617,6 +617,25 @@ namespace OpenTK.Platform.MacOS.Carbon
return result; return result;
} }
}
static internal OSStatus GetEventMouseLocation(IntPtr inEvent, out HIPoint pt)
{
HIPoint point;
unsafe
{
HIPoint* parm = &point;
OSStatus result = API.GetEventParameter(inEvent,
EventParamName.MouseLocation, EventParamType.typeHIPoint, IntPtr.Zero,
(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(HIPoint)), IntPtr.Zero,
(IntPtr)parm);
pt = point;
return result;
}
} }
static internal MacOSKeyModifiers GetEventKeyModifiers(IntPtr inEvent) static internal MacOSKeyModifiers GetEventKeyModifiers(IntPtr inEvent)
{ {
@ -676,6 +695,7 @@ namespace OpenTK.Platform.MacOS.Carbon
internal static void InstallApplicationEventHandler(IntPtr uppHandlerProc, internal static void InstallApplicationEventHandler(IntPtr uppHandlerProc,
EventTypeSpec[] eventTypes, IntPtr userData, IntPtr handlerRef) EventTypeSpec[] eventTypes, IntPtr userData, IntPtr handlerRef)
{ {
OSStatus error = _InstallEventHandler(GetApplicationEventTarget(), uppHandlerProc, OSStatus error = _InstallEventHandler(GetApplicationEventTarget(), uppHandlerProc,
eventTypes.Length, eventTypes, eventTypes.Length, eventTypes,
userData, handlerRef); userData, handlerRef);