Exemple #1
0
        /// <summary>
        /// Gets the current vector value of the axis with the specified key.
        /// </summary>
        /// <param name="axisKey">The key of the axis.</param>
        /// <returns>Axis value.</returns>
        public FVector GetVectorAxisValue(FKey axisKey)
        {
            FVector result;

            Native_UInputComponent.GetVectorAxisValue(Address, ref axisKey, out result);
            return(result);
        }
Exemple #2
0
        /// <summary>
        /// Binds a gesture event to a delegate function.
        /// Returned reference is only guaranteed to be valid until another gesture event is bound.
        /// </summary>
        public FInputGestureBindingHandle BindGesture(FKey gestureKey, FInputGestureHandler handler)
        {
            IntPtr  functionAddress;
            UObject obj;

            if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj))
            {
                return((FInputGestureBindingHandle)Native_UInputComponent.BindGesture(
                           Address, ref gestureKey, obj.Address, functionAddress));
            }
            return(default(FInputGestureBindingHandle));
        }
Exemple #3
0
        public FInputTouchBindingHandle BindTouch(EInputEventType keyEvent, FInputTouchHandler handler)
        {
            IntPtr  functionAddress;
            UObject obj;

            if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj))
            {
                return((FInputTouchBindingHandle)Native_UInputComponent.BindTouch(
                           Address, (byte)keyEvent, obj.Address, functionAddress));
            }
            return(default(FInputTouchBindingHandle));
        }
Exemple #4
0
        /// <summary>
        /// Binds a delegate function to a vector axis key (e.g. Tilt)
        /// Returned reference is only guaranteed to be valid until another vector axis key is bound.
        /// </summary>
        public FInputVectorAxisBindingHandle BindVectorAxis(FKey axisKey, FInputVectorAxisHandler handler)
        {
            IntPtr  functionAddress;
            UObject obj;

            if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj))
            {
                return((FInputVectorAxisBindingHandle)Native_UInputComponent.BindVectorAxis(
                           Address, ref axisKey, obj.Address, functionAddress));
            }
            return(default(FInputVectorAxisBindingHandle));
        }
Exemple #5
0
        /// <summary>
        /// Binds a delegate function an Axis defined in the project settings.
        /// Returned reference is only guaranteed to be valid until another axis is bound.
        /// </summary>
        public FInputAxisBindingHandle BindAxis(string axisName, FInputAxisHandler handler)
        {
            IntPtr  functionAddress;
            UObject obj;

            if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj))
            {
                FName axisFName = (FName)axisName;
                return((FInputAxisBindingHandle)Native_UInputComponent.BindAxis(
                           Address, ref axisFName, obj.Address, functionAddress));
            }
            return(default(FInputAxisBindingHandle));
        }
Exemple #6
0
        /// <summary>
        /// Binds a delegate function to an Action defined in the project settings.
        /// Returned reference is only guaranteed to be valid until another action is bound.
        /// </summary>
        public FInputActionBindingHandle BindAction(string actionName, EInputEventType keyEvent, FInputActionHandler handler)
        {
            IntPtr  functionAddress;
            UObject obj;

            if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj))
            {
                FName actionFName = (FName)actionName;
                return((FInputActionBindingHandle)Native_UInputComponent.BindAction(
                           Address, ref actionFName, (byte)keyEvent, obj.Address, functionAddress));
            }
            return(default(FInputActionBindingHandle));
        }
Exemple #7
0
        /// <summary>
        /// Binds a chord event to a delegate function.
        /// Returned reference is only guaranteed to be valid until another input key is bound.
        /// </summary>
        public FInputKeyBindingHandle BindKey(FInputChord inputChord, EInputEventType keyEvent, FInputActionHandler handler)
        {
            IntPtr  functionAddress;
            UObject obj;

            if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj))
            {
                return((FInputKeyBindingHandle)Native_UInputComponent.BindKeyChord(
                           Address,
                           ref inputChord.Key, inputChord.Shift, inputChord.Ctrl, inputChord.Alt, inputChord.Cmd,
                           (byte)keyEvent, obj.Address, functionAddress));
            }
            return(default(FInputKeyBindingHandle));
        }
Exemple #8
0
        /// <summary>
        /// Binds a key event to a delegate function.
        /// Returned reference is only guaranteed to be valid until another input key is bound.
        /// </summary>
        public FInputKeyBindingHandle BindKey(FKey key, EInputEventType keyEvent, FInputActionHandler handler)
        {
            IntPtr  functionAddress;
            UObject obj;

            if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj))
            {
                return((FInputKeyBindingHandle)Native_UInputComponent.BindKey(
                           Address, ref key, (byte)keyEvent, obj.Address, functionAddress));
            }
            else
            {
                LogFunctionNotFound("BindKey", keyEvent.ToString(), handler);
            }
            return(default(FInputKeyBindingHandle));
        }
Exemple #9
0
 /// <summary>
 /// Indicates that the InputComponent is interested in knowing/consuming a vector axis key's
 /// value (via GetVectorAxisKeyValue) but does not want a delegate function called each frame.
 /// Returned reference is only guaranteed to be valid until another vector axis key is bound.
 /// </summary>
 public FInputVectorAxisBindingHandle BindVectorAxis(FKey axisKey)
 {
     return((FInputVectorAxisBindingHandle)Native_UInputComponent.BindVectorAxisKey(Address, ref axisKey));
 }
Exemple #10
0
        /// <summary>
        /// Indicates that the InputComponent is interested in knowing the Axis value
        /// (via GetAxisValue) but does not want a delegate function called each frame.
        /// Returned reference is only guaranteed to be valid until another axis is bound.
        /// </summary>
        public FInputAxisBindingHandle BindAxis(string axisName)
        {
            FName axisFName = (FName)axisName;

            return((FInputAxisBindingHandle)Native_UInputComponent.BindAxisName(Address, ref axisFName));
        }
Exemple #11
0
 /// <summary>
 /// Clears all cached binding values.
 /// </summary>
 public void ClearBindingValues()
 {
     Native_UInputComponent.ClearBindingValues(Address);
 }
Exemple #12
0
 /// <summary>
 /// Adds the specified action binding.
 /// </summary>
 /// <param name="binding">The binding to add.</param>
 /// <returns>The last binding in the list.</returns>
 public FInputActionBindingHandle AddActionBinding(FInputActionBindingHandle binding)
 {
     return((FInputActionBindingHandle)Native_UInputComponent.AddActionBinding(Address, binding.Address));
 }
Exemple #13
0
 /// <summary>
 /// Gets the number of action bindings.
 /// </summary>
 /// <returns>Number of bindings.</returns>
 public int GetNumActionBindings()
 {
     return(Native_UInputComponent.GetNumActionBindings(Address));
 }
Exemple #14
0
 /// <summary>
 /// Gets the action binding with the specified index.
 /// </summary>
 /// <param name="bindingIndex">The index of the binding to get.</param>
 /// <returns></returns>
 public FInputActionBindingHandle GetActionBinding(int bindingIndex)
 {
     return((FInputActionBindingHandle)Native_UInputComponent.GetActionBinding(Address, bindingIndex));
 }
Exemple #15
0
 /// <summary>
 /// Gets the current value of the axis with the specified name.
 /// </summary>
 /// <param name="axisName">The name of the axis.</param>
 /// <returns>Axis value.</returns>
 public float GetAxisValue(FName axisName)
 {
     return(Native_UInputComponent.GetAxisValue(Address, ref axisName));
 }
Exemple #16
0
 /// <summary>
 /// Gets the current value of the axis with the specified key.
 /// </summary>
 /// <param name="axisKey">The key of the axis.</param>
 /// <returns>Axis value.</returns>
 public float GetAxisKeyValue(FKey axisKey)
 {
     return(Native_UInputComponent.GetAxisKeyValue(Address, ref axisKey));
 }
Exemple #17
0
 /// <summary>
 /// Removes the action binding at the specified index.
 /// </summary>
 /// <param name="bindingIndex">The index of the binding to remove.</param>
 public void RemoveActionBinding(int bindingIndex)
 {
     Native_UInputComponent.RemoveActionBinding(Address, bindingIndex);
 }
Exemple #18
0
 /// <summary>
 /// Checks whether this component has any input bindings.
 /// </summary>
 /// <returns>true if any bindings are set, false otherwise.</returns>
 public bool HasBindings()
 {
     return(Native_UInputComponent.HasBindings(Address));
 }
Exemple #19
0
 /// <summary>
 /// Removes given action binding for the given name.
 /// </summary>
 /// <param name="name">The name of the binding to remove.</param>
 public void RemoveActionBinding(FName name)
 {
     Native_UInputComponent.RemoveActionBindingByName(Address, ref name);
 }
Exemple #20
0
 /// <summary>
 /// Removes all action bindings.
 /// </summary>
 public void ClearActionBindings()
 {
     Native_UInputComponent.ClearActionBindings(Address);
 }
Exemple #21
0
 /// <summary>
 /// Removes the given action binding.
 /// </summary>
 /// <param name="binding">The action binding to remove.</param>
 public void RemoveActionBinding(FInputActionBindingHandle binding)
 {
     Native_UInputComponent.RemoveActionBindingByHandle(Address, binding.Address);
 }