当前位置: 首页>>代码示例>>C#>>正文


C# Controller.SetPolicyFlags方法代码示例

本文整理汇总了C#中Leap.Controller.SetPolicyFlags方法的典型用法代码示例。如果您正苦于以下问题:C# Controller.SetPolicyFlags方法的具体用法?C# Controller.SetPolicyFlags怎么用?C# Controller.SetPolicyFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Leap.Controller的用法示例。


在下文中一共展示了Controller.SetPolicyFlags方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Form1

 public Form1()
 {
     InitializeComponent();
     oCamera = new InventorCamera();
     controller = new Controller();
     InitializeTexBox();
     AddToLog("Component initialization.");
     Thread.Sleep(100); // wait for connection
     if (controller.Devices.IsEmpty)
     {
         AddToLog("ERROR: No connection to Leap Motion service.");
         AddToLog("ERROR: Connect device and restart application.");
         return;
     }
     else
     {
         AddToLog("Connected to Leap Motion service.");
         controller.EnableGesture(Gesture.GestureType.TYPE_SWIPE);
         controller.EnableGesture(Gesture.GestureType.TYPE_CIRCLE);
         listener = new LeapEventListener(this);
         controller.SetPolicyFlags(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
         controller.AddListener(listener);
     }
     if (!oCamera.IsStarted())
         AddToLog("ERROR: Inventor instance not found.");
     else
         AddToLog("Iventor instance found. ");
     if (!oCamera.IsOpened())
         AddToLog("ERROR: Assembly, part or presentation document not found.");
     else
         AddToLog(oCamera.GetDocType() + " document found.");
 }
开发者ID:harrykeen18,项目名称:InventorIntegration,代码行数:32,代码来源:Form1.cs

示例2: LeapInterface

        public LeapInterface()
        {
            listener = new LeapListener();
            controller = new Controller();
            controller.SetPolicyFlags(Controller.PolicyFlag.POLICYBACKGROUNDFRAMES);

            Start();
        }
开发者ID:RomeoInc,项目名称:InCarGestureInteraction,代码行数:8,代码来源:LeapInterface.cs

示例3: OnInit

 public override void OnInit(Controller controller)
 {
     controller.EnableGesture(Gesture.GestureType.TYPECIRCLE);
     controller.EnableGesture(Gesture.GestureType.TYPEKEYTAP);
     controller.EnableGesture(Gesture.GestureType.TYPESCREENTAP);
     controller.EnableGesture(Gesture.GestureType.TYPESWIPE);
     controller.SetPolicyFlags(Controller.PolicyFlag.POLICYBACKGROUNDFRAMES);
 }
开发者ID:NicolasDorier,项目名称:GestSpace,代码行数:8,代码来源:ReactiveListener.cs

示例4: OnConnect

 public override void OnConnect(Controller controller)
 {
     controller.SetPolicyFlags(Controller.PolicyFlag.POLICY_IMAGES);
     //enable all four types of gestures
     controller.EnableGesture(Gesture.GestureType.TYPE_SWIPE);
     controller.EnableGesture(Gesture.GestureType.TYPE_KEY_TAP);
     controller.EnableGesture(Gesture.GestureType.TYPE_SCREEN_TAP);
     controller.EnableGesture(Gesture.GestureType.TYPE_CIRCLE);
     this.eventDelegate.LeapEventNotification("onConnect");
 }
开发者ID:Fivepoints,项目名称:LeapTutorial1,代码行数:10,代码来源:MainWindow.xaml.cs

示例5: Main

        static void Main(string[] args)
        {
            Console.Title = "Leap Mousion v2.0";
            Console.WriteLine("Leap Mousion v2.0 by TangoChen    :)\r\n------------------------------------\r\nBlog: TangoChen.com\r\nYoutube Channel: www.youtube.com/tan9ochen\r\n--------------------\r\nTwitter:\ttwitter.com/tangochen\[email protected]\r\n微博(Weibo):\tweibo.com/tangochen\[email protected]\r\n--------------------\r\nPress any key to exit...\r\n--------------------");

            // Create a sample listener and controller
            SampleListener listener = new SampleListener();
            Controller controller = new Controller();

            foreach (string arg in args)
            {
                switch (arg.Substring(0, 1).ToLower())
                {
                    case "l": // L = Set isLeftHanded = true;
                        listener.isLeftHanded = true;
                        break;
                    case "s": // Scale
                        float.TryParse(arg.Substring(1), out listener.moveScale);
                        break;
                    case "r": // Reverse Orientation
                        /*
                         * It won't just reverse the horizontal axes but also change the fingerIndex...
                         * So this is used when the device get reversed horizontal axes
                         * and you don't want to click the [Reverse Orientation] inside the [Leap Motion Controller Settings] or
                         * rotate the device...
                         */
                        listener.isReversed = true;
                        break;
                    case "c": // Click-Only
                        listener.isClickOnly = true;
                        break;
                }
            }

            Console.WriteLine(
                "Speed: " + listener.moveScale.ToString() +
                "\r\nClick-Only: " + listener.isClickOnly.ToString() +
                "\r\nReversed: " + listener.isReversed.ToString() +
                "\r\nLeft Handed Mode: " + (listener.isLeftHanded ? "Enabled" : "Disabled") +
                "\r\n--------------------"
                );

            // Receive frames of tracking data while in the background
            controller.SetPolicyFlags(Controller.PolicyFlag.POLICYBACKGROUNDFRAMES);

            // Have the sample listener receive events from the controller
            controller.AddListener(listener);

            // Keep this process running until any key is pressed
            Console.ReadKey(true); //System.Diagnostics.Process.Start("pause"); Won't work...

            // Remove the sample listener when done
            controller.RemoveListener(listener);
            controller.Dispose();
        }
开发者ID:TangoChen,项目名称:LeapMousion,代码行数:55,代码来源:Program.cs

示例6: LeapInterface

        /// <summary>
        /// Constructor for LeapInterface class
        /// </summary>
        public LeapInterface()
        {
            // Create a listener and controller
            this.listener = new LeapListener();
            this.controller = new Controller();

            // Have the sample listener receive events from the controller
            controller.AddListener(listener);
            controller.SetPolicyFlags(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);

            // Register event handler
            listener.GestureMade += new EventHandler<GestureEvent>(ProcessGesture);
        }
开发者ID:JakeCowton,项目名称:GestureSpotifyController,代码行数:16,代码来源:LeapInterface.cs

示例7: Main

        public static void Main()
        {
            using (UniListener listener = new UniListener())
            {
                using (Controller controller = new Controller())
                {
                    controller.SetPolicyFlags(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);

                    // Have the listener receive events from the controller
                    controller.AddListener(listener);

                    // Keep this process running until Enter is pressed
                    Console.WriteLine("Press Enter to quit...");
                    string result = Console.ReadLine();

                    // Remove the listener when done
                    controller.RemoveListener(listener);
                }
            }
        }
开发者ID:rothda,项目名称:UniController2,代码行数:20,代码来源:Program.cs

示例8: OnInit

 public override void OnInit(Controller controller)
 {
     _LogAction("Initialized");
     controller.SetPolicyFlags(Controller.PolicyFlag.POLICYBACKGROUNDFRAMES);
 }
开发者ID:RossDay,项目名称:Leap,代码行数:5,代码来源:MainListener.cs

示例9: Init

 public void Init()
 {
     _leapController = new Controller();
     _leapController.SetPolicyFlags(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
 }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:5,代码来源:LeapInput.cs

示例10: OnConnect

        public override void OnConnect(Controller controller)
        {
            SafeWriteLine("Connected");

            // enable gesture recognition for screen locking
            controller.EnableGesture(Gesture.GestureType.TYPECIRCLE);
            //controller.EnableGesture(Gesture.GestureType.TYPEKEYTAP);
            //controller.EnableGesture(Gesture.GestureType.TYPESCREENTAP);
            //controller.EnableGesture(Gesture.GestureType.TYPESWIPE);
            controller.SetPolicyFlags(Controller.PolicyFlag.POLICYBACKGROUNDFRAMES);
        }
开发者ID:RealtaNua,项目名称:Leap_Interface,代码行数:11,代码来源:LeapListener.cs

示例11: OnInit

 public override void OnInit(Controller controller)
 {
     SafeWriteLine("Initialized");
     stopWatch = new Stopwatch();
     stopWatch.Start();
     controller.SetPolicyFlags(Controller.PolicyFlag.POLICYBACKGROUNDFRAMES);
 }
开发者ID:Brejlounek,项目名称:Leap-Input,代码行数:7,代码来源:MouseListener.cs

示例12: OnInit

 public override void OnInit(Controller controller)
 {
     SafeWriteLine("Initialized");
     controller.SetPolicyFlags(Controller.PolicyFlag.POLICYBACKGROUNDFRAMES);
 }
开发者ID:RossDay,项目名称:Leap,代码行数:5,代码来源:SandboxListener.cs

示例13: HandleController

        // Enables/Disables the controller based on the visibility of the overlay
        public void HandleController(object sender, DependencyPropertyChangedEventArgs e)
        {
            Window overlay = sender as Window;

            if (overlay.Visibility == Visibility.Hidden)
            {
                leap.RemoveListener(listener);
                leap.Dispose();
            }
            else if (overlay.Visibility == Visibility.Visible)
            {
                leap = new Controller();

                // Runs the leap constantly so it can be used when the window loses focus
                if (leap.PolicyFlags != Controller.PolicyFlag.POLICYBACKGROUNDFRAMES)
                {
                    leap.SetPolicyFlags(Controller.PolicyFlag.POLICYBACKGROUNDFRAMES);
                }

                leap.AddListener(listener);
            }
        }
开发者ID:pgwri,项目名称:LeapIN,代码行数:23,代码来源:MainInterface.cs


注:本文中的Leap.Controller.SetPolicyFlags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。