/// <summary>
 /// Requests clearing a policy.
 ///
 /// Policy changes are completed asynchronously and, because they are subject
 /// to user approval or system compatibility checks, may not complete successfully. Call
 /// Controller.IsPolicySet() after a suitable interval to test whether
 /// the change was accepted.
 /// @since 2.1.6
 /// </summary>
 public void ClearPolicy(PolicyFlag policy)
 {
     _connection.ClearPolicy(policy);
 }
 /// <summary>
 /// Gets the active setting for a specific policy.
 ///
 /// Keep in mind that setting a policy flag is asynchronous, so changes are
 /// not effective immediately after calling setPolicyFlag(). In addition, a
 /// policy request can be declined by the user. You should always set the
 /// policy flags required by your application at startup and check that the
 /// policy change request was successful after an appropriate interval.
 ///
 /// If the controller object is not connected to the Leap Motion software, then the default
 /// state for the selected policy is returned.
 ///
 /// @since 2.1.6
 /// </summary>
 public bool IsPolicySet(PolicyFlag policy)
 {
     return(_connection.IsPolicySet(policy));
 }
 /// <summary>
 /// Requests setting a policy.
 ///
 /// A request to change a policy is subject to user approval and a policy
 /// can be changed by the user at any time (using the Leap Motion settings dialog).
 /// The desired policy flags must be set every time an application runs.
 ///
 /// Policy changes are completed asynchronously and, because they are subject
 /// to user approval or system compatibility checks, may not complete successfully. Call
 /// Controller.IsPolicySet() after a suitable interval to test whether
 /// the change was accepted.
 /// @since 2.1.6
 /// </summary>
 public void SetPolicy(PolicyFlag policy)
 {
     _connection.SetPolicy(policy);
 }
Example #4
0
 public static bool IsPolicySet(Leap.Controller controller, out Leap.Controller controllerOut, PolicyFlag policy)
 {
     controllerOut = controller;
     return(controller.IsPolicySet((Leap.Controller.PolicyFlag)policy));
 }
Example #5
0
        /* Policy setting requests
         * A request to change a policy is subject to user approval and a policy can be changed by the user at any time
         * (using the Leap Motion settings dialog).
         * The desired policy flags must be set every time an application runs.
         * Policy changes are completed asynchronously and, because they are subject to user approval or system compatibility checks, may not complete successfully.
         * Call Controller::isPolicySet() after a suitable interval to test whether the change was accepted.
         */

        public static void SetPolicy(Leap.Controller controller, out Leap.Controller controllerOut, PolicyFlag policy, bool set)
        {
            controllerOut = controller;
            if (set)
            {
                controller.SetPolicy((Leap.Controller.PolicyFlag)policy);
            }
            else
            {
                controller.ClearPolicy((Leap.Controller.PolicyFlag)policy);
            }
        }
Example #6
0
 /// <summary>
 /// Requests setting a policy.
 ///
 /// A request to change a policy is subject to user approval and a policy
 /// can be changed by the user at any time (using the Leap Motion settings dialog).
 /// The desired policy flags must be set every time an application runs.
 ///
 /// Policy changes are completed asynchronously and, because they are subject
 /// to user approval or system compatibility checks, may not complete successfully. Call
 /// Controller.IsPolicySet() after a suitable interval to test whether
 /// the change was accepted.
 /// @since 2.1.6
 /// </summary>
 public void SetAndClearPolicy(PolicyFlag set, PolicyFlag clear)
 {
     _connection.SetAndClearPolicy(set, clear);
 }
Example #7
0
 /// <summary>
 /// Requests setting a policy.
 ///
 /// A request to change a policy is subject to user approval and a policy
 /// can be changed by the user at any time (using the Leap Motion settings dialog).
 /// The desired policy flags must be set every time an application runs.
 ///
 /// Policy changes are completed asynchronously and, because they are subject
 /// to user approval or system compatibility checks, may not complete successfully. Call
 /// Controller.IsPolicySet() after a suitable interval to test whether
 /// the change was accepted.
 /// @since 2.1.6
 /// </summary>
 public void SetAndClearPolicy(PolicyFlag set, PolicyFlag clear, string deviceSerial = "")
 {
     _connection.SetAndClearPolicy(set, clear);
 }