admin管理员组文章数量:1323200
Is there a way to capture mouse events like hover and click even when Electron window is not focused? So that my buttons' hover/click effects still work?
Right now, I need to first switch to the Electron window either by clicking or alt-tabbing for the mouse events to be captured.
I'm fairly new to js and electron and I can't seem to find anything on this. But since it works with Atom editor, I'm assuming its possible?
Do I need additional module like mentioned in this post for capturing keyboard events: Atom Electron capture all keyboard events even when app is unfocused?
Thanks! Appreciate any help.
Is there a way to capture mouse events like hover and click even when Electron window is not focused? So that my buttons' hover/click effects still work?
Right now, I need to first switch to the Electron window either by clicking or alt-tabbing for the mouse events to be captured.
I'm fairly new to js and electron and I can't seem to find anything on this. But since it works with Atom editor, I'm assuming its possible?
Do I need additional module like mentioned in this post for capturing keyboard events: Atom Electron capture all keyboard events even when app is unfocused?
Thanks! Appreciate any help.
Share Improve this question edited Jul 26, 2019 at 18:11 Tim asked Jul 26, 2019 at 17:53 TimTim 3,4271 gold badge19 silver badges27 bronze badges1 Answer
Reset to default 8When creating a new Electron window using new BrowserWindow
, it is possible to have mouse click events captured even when the window is not focused by adding:
acceptFirstMouse: true
to the BrowserWindow options.
As for capturing mouse hover events, I'm afraid this is not possible out of the box.
本文标签: javascriptElectron capture mouse events when window is not focusedStack Overflow
版权声明:本文标题:javascript - Electron capture mouse events when window is not focused - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742091672a2420304.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论