Search code examples
c#wpfleap-motion

how to set WPF to allways recognize input


I am working on an wpf project with leap motion. My programm is allways checking for input via the leap motion controller and does something with it.

But when I open another programm (and my wpf gets in the background) my wpf freezes.

Is there a way my programm will not freeze even if I open another programm in fullscreen ?

EDIT: here is how i get my input:

 public MainWindow()
 {
        InitializeComponent();

        CompositionTarget.Rendering += Update;
 }

 protected void Update(object sender, EventArgs e)
 {
        //get frame
        Leap.Frame frame = leap.Frame();

        ...
 }

Solution

  • Thank you Charles Ward this did it for me:

    controller.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
    

    Leap doesn't seem to update when wpf window isn't active