问题
I am trying to use output from the leap in WPF. However whenever I unfocus the window (for instance by pressing alt+tab), the leap stops giving output. So my question is, how to make sure the leap will output even when focused on a second application?
回答1:
You just need to set the Leap Motion API background frames policy.
controller.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
回答2:
WPF won't listen to any events outside its window. You have to explicitly set it up by yourself to listen to "globally" events.
An example of a global event is listening to keyboard even outside WPF's window
来源:https://stackoverflow.com/questions/28728839/leap-doesnt-seem-to-update-when-wpf-window-isnt-active