简体   繁体   中英

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();

        ...
 }

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM