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

Android: Somewhat align scancode conversions with Firefox #4023

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Dec 1, 2024

Similar to #4019, but for Android, and only for the Firefox sources (haven't gone through Chromium's sources for this kind of stuff yet).

Firefox' sources seems to use some other form of scan code that I couldn't figure out? So instead we try to map as many of the codes available on Keycode that they do as possible.

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

@madsmtm madsmtm added S - enhancement Wouldn't this be the coolest? DS - android labels Dec 1, 2024
@madsmtm madsmtm requested a review from MarijnS95 as a code owner December 1, 2024 22:02
Firefox' source at:
https://searchfox.org/mozilla-central/rev/c597e9c789ad36af84a0370d395be066b7dc94f4/widget/NativeKeyToDOMCodeName.h

Seems to use some other form of scan code? So instead we try to map as
many of the codes available on `Keycode` that they do as possible.
@madsmtm madsmtm force-pushed the madsmtm/android-scancode-firefox branch from b538cef to 27840eb Compare December 2, 2024 12:11
Copy link
Member

@MarijnS95 MarijnS95 left a comment

Choose a reason for hiding this comment

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

Is this completing the list, or should we try to rewrite it using the latest codes from the latest NDK sources? New keycodes will be added in next release for example.

EDIT: i.e. this PR also doesn't seem to change/align things, just adds a few missing key conversions. Unless this PR (second paragraph) is a question for Android maintainers to see if we can align with Firefox sources?

@@ -75,6 +75,7 @@ changelog entry.
variables to test the respective modifiers of window creation.
- Added `Window::surface_position`, which is the position of the surface inside the window.
- Added `Window::safe_area`, which describes the area of the surface that is unobstructed.
- On Android, improved scancode conversions for more obscure key codes.
Copy link
Member

Choose a reason for hiding this comment

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

s/improved/added?

@madsmtm
Copy link
Member Author

madsmtm commented Jan 2, 2025

I can't remember exactly what I did, but I think I just looked at Firefox sources, saw that for example they map some kind of key code 0x00A1 that I don't know where comes from to Eject, and then I found what seemed to semantically match that "eject", in this case AKEYCODE_MEDIA_EJECT, and mapped it that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DS - android S - enhancement Wouldn't this be the coolest?
Development

Successfully merging this pull request may close these issues.

2 participants