简体   繁体   English

node-webkit:如何检测用户使用的屏幕/监视器数量?

[英]node-webkit: How can I detect how many screen/monitor user have using?

I'm developing a multiscreen app where I need to detect how many screen user have. 我正在开发一个多屏幕应用程序,我需要检测有多少屏幕用户。 Also I need to create that many window and move those window to every screen. 此外,我需要创建那么多窗口并将这些窗口移动到每个屏幕。 So I basically need a way to know how many screen the user have and also a way to move my window to a specific screen. 所以我基本上需要一种方法来了解用户拥有多少屏幕,以及将窗口移动到特定屏幕的方法。

Does nodewebkit already have solution for that? nodewebkit是否已经有解决方案? If not is there any alternative solution/hacks I might be able to use? 如果没有,我可以使用任何替代解决方案/黑客?

Found the solution as new Screen Geometry added at node-webkit v0.10.2. 在node-webkit v0.10.2中添加了新的Screen Geometry,找到了解决方案。 This will let you listen to Screen Bound, Display add, Display remove events. 这将让您收听屏幕绑定,显示添加,显示删除事件。

Here is the documentation - https://github.com/rogerwang/node-webkit/wiki/Screen 这是文档 - https://github.com/rogerwang/node-webkit/wiki/Screen

This is added by a very recently new commit on nodewebkit to resolve this issue - https://github.com/rogerwang/node-webkit/pull/2178 . 最近由nodewebkit上的新提交添加了这个来解决此问题 - https://github.com/rogerwang/node-webkit/pull/2178

Note - I did not test the code but looks like this is what I was looking for. 注意 - 我没有测试代码,但看起来这就是我想要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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