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

对着背影说爱祢 提交于 2019-12-13 05:53:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!