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: expose location and modifiers on before-input-event #29850
Conversation
Release Notes Persisted
|
dict.Set("alt", (in.GetModifiers() & Modifiers::kAltKey) != 0); | ||
dict.Set("meta", (in.GetModifiers() & Modifiers::kMetaKey) != 0); | ||
dict.Set("location", GetKeyLocationCode(in)); | ||
dict.Set("_modifiers", in.GetModifiers()); |
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.
@nornagon Curious why this is exposed?
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.
I left it as an escape hatch in case there are other modifiers which we don't currently expose elsewhere that an app wants to detect. It's undocumented, but this makes it possible to build a workaround in older versions of the app for detecting unsupported modifiers while we add support to newer versions.
…9850) * feat: expose location and modifiers on before-input-event * lint
Description of Change
This adds two new values to the
before-input-event
details object:location
and
modifiers
. The latter matches the existing behavior ofInputEvent
,previously only used for creating input events (e.g. with
WebContents.sendInputEvent
).Closes #29845
Checklist
npm test
passesRelease Notes
Notes: Added
location
andmodifiers
to the event properties provided in the'before-input-event'
WebContents event.The text was updated successfully, but these errors were encountered: