Skip to content

NEW: Correctly expose Media keys through keyboard #2212

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

Merged
merged 19 commits into from
Aug 7, 2025

Conversation

todi1856
Copy link
Member

@todi1856 todi1856 commented Aug 1, 2025

Description

See https://github.cds.internal.unity3d.com/unity/unity/pull/74515 for details

Testing status & QA

Added coverage in unity/unity repo, also manually tested media keys on FireTV using Media.zip from https://jira.unity3d.com/browse/UUM-113004

Overall Product Risks

  • Complexity: Low
  • Halo Effect: Low

Comments to reviewers

Please describe any additional information such as what to focus on, or historical info for the reviewers.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

@codecov-github-com
Copy link

codecov-github-com bot commented Aug 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

@@             Coverage Diff             @@
##           develop    #2212      +/-   ##
===========================================
+ Coverage    68.09%   68.11%   +0.01%     
===========================================
  Files          367      367              
  Lines        53602    53629      +27     
===========================================
+ Hits         36500    36529      +29     
+ Misses       17102    17100       -2     
Flag Coverage Δ
linux_2021.3_pkg 5.46% <90.32%> (+0.04%) ⬆️
linux_2021.3_project 70.37% <100.00%> (+0.01%) ⬆️
linux_2022.3_pkg 5.23% <90.32%> (+0.04%) ⬆️
linux_2022.3_project 65.21% <100.00%> (+0.01%) ⬆️
linux_6000.0_pkg 5.24% <90.32%> (+0.04%) ⬆️
linux_6000.0_project 68.01% <100.00%> (+0.01%) ⬆️
linux_6000.1_pkg 5.24% <90.32%> (+0.04%) ⬆️
linux_6000.1_project 68.01% <100.00%> (+0.01%) ⬆️
linux_6000.2_pkg 5.24% <90.32%> (+0.04%) ⬆️
linux_6000.2_project 68.02% <100.00%> (+0.02%) ⬆️
linux_trunk_pkg 5.24% <90.32%> (+0.04%) ⬆️
linux_trunk_project 68.01% <100.00%> (+0.01%) ⬆️
mac_2021.3_pkg 5.45% <90.32%> (+0.04%) ⬆️
mac_2021.3_project 70.38% <100.00%> (+0.01%) ⬆️
mac_2022.3_pkg 5.23% <90.32%> (+0.04%) ⬆️
mac_2022.3_project 65.24% <100.00%> (+0.01%) ⬆️
mac_6000.0_pkg 5.23% <90.32%> (+0.04%) ⬆️
mac_6000.0_project 68.04% <100.00%> (+0.02%) ⬆️
mac_6000.1_pkg 5.23% <90.32%> (+0.04%) ⬆️
mac_6000.1_project 68.03% <100.00%> (+0.01%) ⬆️
mac_6000.2_pkg 5.23% <90.32%> (+0.04%) ⬆️
mac_6000.2_project 68.03% <100.00%> (+0.01%) ⬆️
mac_trunk_pkg 5.23% <90.32%> (+0.04%) ⬆️
mac_trunk_project 68.03% <100.00%> (+0.01%) ⬆️
win_2021.3_pkg 5.45% <90.32%> (+0.04%) ⬆️
win_2021.3_project 70.45% <100.00%> (+0.01%) ⬆️
win_2022.3_pkg 5.23% <90.32%> (+0.04%) ⬆️
win_2022.3_project 65.31% <100.00%> (+0.01%) ⬆️
win_6000.0_pkg 5.24% <90.32%> (+0.04%) ⬆️
win_6000.0_project 68.11% <100.00%> (+0.01%) ⬆️
win_6000.1_pkg 5.24% <90.32%> (+0.04%) ⬆️
win_6000.1_project 68.11% <100.00%> (+0.01%) ⬆️
win_6000.2_pkg 5.24% <90.32%> (+0.04%) ⬆️
win_6000.2_project 68.10% <100.00%> (+0.01%) ⬆️
win_trunk_pkg 5.24% <90.32%> (+0.04%) ⬆️
win_trunk_project 68.10% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
....unity.inputsystem/InputSystem/Devices/Keyboard.cs 95.25% <100.00%> (+0.05%) ⬆️
...em/InputSystem/Devices/Precompiled/FastKeyboard.cs 100.00% <100.00%> (ø)
...m.unity.inputsystem/InputSystem/InputExtensions.cs 52.38% <ø> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@jfreire-unity jfreire-unity left a comment

Choose a reason for hiding this comment

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

👍
I compared with latest #2075 PR that also added more keys and only found one thing missing which I commented.

@jfreire-unity jfreire-unity self-requested a review August 5, 2025 10:54
Copy link
Collaborator

@jfreire-unity jfreire-unity left a comment

Choose a reason for hiding this comment

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

Approving but CI errors need to be addressed

@jfreire-unity
Copy link
Collaborator

Approving but CI errors need to be addressed

Ok it's probably something to be done once we release 1.14.2, we need to bump to 1.15 since we're adding new APIs.

@todi1856
Copy link
Member Author

todi1856 commented Aug 5, 2025

Approving but CI errors need to be addressed

Ok it's probably something to be done once we release 1.14.2, we need to bump to 1.15 since we're adding new APIs.

Alright, I'll wait for 1.15 bump. Thx !

@jfreire-unity jfreire-unity mentioned this pull request Aug 6, 2025
5 tasks
@jfreire-unity jfreire-unity changed the title FIX: [Android] Correctly expose Media keys through keyboard FIX: Correctly expose Media keys through keyboard Aug 6, 2025
@jfreire-unity jfreire-unity changed the title FIX: Correctly expose Media keys through keyboard NEW: Correctly expose Media keys through keyboard Aug 6, 2025
@dri-richard
Copy link

I submitted https://issuetracker.unity3d.com/issues/android-tv-some-of-the-remote-controls-not-detected-with-inputsystem-dot-devices which I think this PR is designed to address, so I thought I'd try this branch out.

Do you have any guidance on how to use it? I added bindings for:
MediaRewind[ Keyboard]
MediaForward [Keyboard]
MediaPlayPause [Keyboard]
ContextMenu [Keyboard]

and added logging of any action being performed, and of these 4 only ContextMenu was triggered when using a Fire TV remote.

@todi1856
Copy link
Member Author

todi1856 commented Aug 6, 2025

I submitted https://issuetracker.unity3d.com/issues/android-tv-some-of-the-remote-controls-not-detected-with-inputsystem-dot-devices which I think this PR is designed to address, so I thought I'd try this branch out.

Do you have any guidance on how to use it? I added bindings for: MediaRewind[ Keyboard] MediaForward [Keyboard] MediaPlayPause [Keyboard] ContextMenu [Keyboard]

and added logging of any action being performed, and of these 4 only ContextMenu was triggered when using a Fire TV remote.

@dri-richard this PR only covers the frontend, the backend changes (where Unity forwards Android input data to input system package) are in internal PR, not accessible publicly. When the internal PR for backend will land, the status in https://issuetracker.unity3d.com/issues/android-tv-some-of-the-remote-controls-not-detected-with-inputsystem-dot-devices will change. Internal PR has to separately land in affected Unity versions - 6000.3, 6000.2, etc

@todi1856
Copy link
Member Author

todi1856 commented Aug 7, 2025

@jfreire-unity
Copy link
Collaborator

jfreire-unity commented Aug 7, 2025

@todi1856 yeah we are aware (also, trunk tests are actually not required for PRs to land in our repo).
I now pulled the latest changes from develop to this PR to run CI again. if that's the only test that fails, we can merge this PR.

@Pauliusd01
Copy link
Collaborator

Sorry was busy with release, taking a look today

@Pauliusd01
Copy link
Collaborator

Since I do need the editor change to actually use these, do we want any kind of documentation or comments to let users know which editors support it? Since IntelliSense will suggest them, users might try it and it will silently fail

@Pauliusd01
Copy link
Collaborator

Other than my comment above, everything seems fine to me. Checked functionality for the added keys and that F24 key still works as well as there was a related change to it. I can approve this, just let me know

@todi1856
Copy link
Member Author

todi1856 commented Aug 7, 2025

Since I do need the editor change to actually use these, do we want any kind of documentation or comments to let users know which editors support it? Since IntelliSense will suggest them, users might try it and it will silently fail

I don't have this information yet, as per https://jira.unity3d.com/browse/UUM-113004 it will land in 2022.3, 6000.0, 6000.1, 6000.2, 6000.3, but I don't know the exact versions yet.

@Pauliusd01
Copy link
Collaborator

Since I do need the editor change to actually use these, do we want any kind of documentation or comments to let users know which editors support it? Since IntelliSense will suggest them, users might try it and it will silently fail

I don't have this information yet, as per https://jira.unity3d.com/browse/UUM-113004 it will land in 2022.3, 6000.0, 6000.1, 6000.2, 6000.3, but I don't know the exact versions yet.

That's good, matches the package release so no need for anything extra then

@todi1856
Copy link
Member Author

todi1856 commented Aug 7, 2025

@Pauliusd01 what now, will somebody from Input team needs to click Merge button ?

P.S I don't have authorization to click Merge.

@Pauliusd01 Pauliusd01 merged commit f9ea658 into develop Aug 7, 2025
134 checks passed
@Pauliusd01 Pauliusd01 deleted the expose-media-keys branch August 7, 2025 10:05
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.

4 participants