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

Initial pass at event mapping #4678

Open
wants to merge 1 commit into
base: experimental/ozone
Choose a base branch
from

Conversation

madhurajayaraman
Copy link
Contributor

Mappings from kSbKeyFoo to ui::DomCode::Bar .

@madhurajayaraman madhurajayaraman requested a review from y4vor January 9, 2025 22:55
@madhurajayaraman
Copy link
Contributor Author

Tested locally, numbers etc work.
I have a list of the other kSbKey that we need to figure out the dom code mapping for.

@@ -60,6 +61,141 @@ constexpr auto kSbKeyToDomCodeMap = base::MakeFixedFlatMap<SbKey, ui::DomCode>({
{kSbKeyChannelDown, ui::DomCode::CHANNEL_DOWN},
{kSbKeyClosedCaption, ui::DomCode::CLOSED_CAPTION_TOGGLE},
{kSbKeyRecord, ui::DomCode::MEDIA_RECORD},

// 0-9, a-z
{kSbKey0, ui::DomCode::DIGIT0},
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to create a new function of class that is self contained and does the translation. You can add unit test and submit it main.

Take a look at: https://source.chromium.org/chromium/chromium/src/+/main:ui/events/x/x11_event_translation.cc
or
https://source.chromium.org/chromium/chromium/src/+/main:ui/events/fuchsia/pointer_events_handler.cc

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, in particular to the unit test part (unit tests for an opinionated mapping can be straightforward, and that's fine).

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

Successfully merging this pull request may close these issues.

3 participants