New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mouse forward functionality on Windows #10183
Changes from 3 commits
a84fa0e
12dbcfa
0736de1
60c0bf1
3d33da7
814702f
d4bbd7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1356,6 +1356,14 @@ removed in future Electron releases. | |
**Note:** The BrowserView API is currently experimental and may change or be | ||
removed in future Electron releases. | ||
|
||
#### `win.setForwardMouseMessages(forward)` _Windows_ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can probably make this an option of the
And I think it is worthwhile to add a simple example for it, otherwise it is still hard to know how to make use of it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Originally I wasn't sure if I could tamper with existing API, but an optional argument that defaults to false should not break anything and I agree that it's cleaner this way. Examples are always good. Where would the example belong? My very simple test application is mostly just a matter of ignoring/acknowledging mouse input as I enter/leave a canvas respectively. Cleaned up it should make a good example if there is a good way to put it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You can make it a sub-chapter of |
||
|
||
* `forward` Boolean | ||
|
||
Forward mouse messages to the window below this one. This is similar to | ||
`setIgnoreMouseEvents`, but additionally allows users to listen to events | ||
related to mouse movement such as `mouseleave`. | ||
|
||
[blink-feature-string]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5?l=62 | ||
[page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API | ||
[quick-look]: https://en.wikipedia.org/wiki/Quick_Look | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would install mouse hook for every Electron apps, we should only do subclass and install the hook when
win.setForwardMouseMessages
is called.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I completely overlooked that. Fixed.