// Bind a delegate directly to a specific type of gesture input, i.e. Keys.Gesture_Pinch public void BindGesture(Key gestureKey, GestureInputCallback callback) { if (IsDestroyedOrPendingKill) { throw new UnrealObjectDestroyedException("Trying to bind input gesture on destroyed input component"); } if (null == callback) { throw new ArgumentNullException("callback"); } UnrealObject targetObj = callback.Target as UnrealObject; unsafe { byte *nativeKeyBuffer = stackalloc byte[InputChord.NativeDataSize]; gestureKey.ToNative(new IntPtr(nativeKeyBuffer)); RegisterGestureInputCallback(NativeObject, targetObj != null ? targetObj.NativeObject : IntPtr.Zero, nativeKeyBuffer, callback); } }
unsafe private extern static void RegisterGestureInputCallback(IntPtr nativeComponentPointer, IntPtr nativeTargetObjectPointer, void *nativeGestureKey, GestureInputCallback callback);