Skip to content
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

Add click event to BrowserWindow #24351

Open
3 tasks done
pushkin- opened this issue Jun 29, 2020 · 2 comments
Open
3 tasks done

Add click event to BrowserWindow #24351

pushkin- opened this issue Jun 29, 2020 · 2 comments

Comments

@pushkin-
Copy link

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem Description

I want to be able to intercept click events for a BrowserWindow (or WebContents), so that I can prevent a timeout. The page in my app checks for activities, but this doesn't work for cross-domain iframes (the 'click' event won't bubble out of the iframe), so I want to detect this at the window level. This will also allow me to intercept clicks on the titlebar and shell of the window.

Proposed Solution

Add 'click' event for the BrowserWindow or WebContents that detects all types of clicks (left, middle, right clicks on the entire window)

Alternatives Considered

Otherwise, I have to hook each Windows message that I care about and handle this myself:

win.hookWindowMessage(0x0202, () => {
    preventTimeout();
    return 0;
});
@Mrhoho

This comment has been minimized.

@Friend-LGA
Copy link

Any update on this? Handling mouse input events looks like the basic functionality to me. Is it possible via some other logic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants