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

feat: replace scroll-touch* with generic input-event #35531

Merged
merged 17 commits into from Sep 27, 2022

Conversation

nornagon
Copy link
Member

Description of Change

This adds a new event to WebContents, input-event, that exposes the
underlying WebInputEvent stream.

As written, this only outputs a generic "WebInputEvent" unless the event is a
keyboard event, in which case it outputs some more information. Ultimately we
should expose all information available for each type of WebInputEvent.

This supercedes the old scroll-touch-edge and scroll-touch-end events, and
replaces scroll-touch-begin with a similar but not quite identical event.
Specifically, scroll-touch-begin used to be emitted when the user placed two
fingers down on the trackpad but before the touches had moved. Now it is only
emitted once the scroll gesture starts happening.

This somewhat overlaps with the before-input-event event on WebContents,
which is similar but only exposes keyboard events, and allows preventing the
event from being processed, which this API does not.

Checklist

Release Notes

Notes:

  • Added WebContents input-event event.
  • Deprecated BrowserWindow scroll-touch-* events.

@nornagon nornagon added no-backport semver/minor backwards-compatible functionality labels Aug 31, 2022
@electron-cation electron-cation bot added new-pr 🌱 PR opened in the last 24 hours api-review/requested 🗳 labels Aug 31, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Sep 7, 2022
@nornagon
Copy link
Member Author

nornagon commented Sep 9, 2022

i fixed the tests to use rawKeyDown instead of keyDown since before-input-event doesn't trigger for keyDown ... but i'm not sure that's the best approach. i think that breaks existing users of sendInputEvent.

docs/breaking-changes.md Show resolved Hide resolved
docs/breaking-changes.md Show resolved Hide resolved
docs/api/browser-window.md Show resolved Hide resolved
docs/breaking-changes.md Outdated Show resolved Hide resolved
lib/browser/api/browser-window.ts Show resolved Hide resolved
@itsananderson
Copy link
Contributor

API LGTM

docs/breaking-changes.md Outdated Show resolved Hide resolved
spec/autofill-spec.ts Outdated Show resolved Hide resolved
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@nornagon nornagon merged commit f82a863 into main Sep 27, 2022
@nornagon nornagon deleted the deprecate-scroll-touch-events branch September 27, 2022 19:47
@release-clerk
Copy link

release-clerk bot commented Sep 27, 2022

Release Notes Persisted

  • Added WebContents input-event event.
  • Deprecated BrowserWindow scroll-touch-* events.

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

Successfully merging this pull request may close these issues.

None yet

5 participants