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

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

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    36527      +27     
  Misses       17102    17102              
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.22% <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.01% <100.00%> (+0.01%) ⬆️
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.01%) ⬆️
mac_6000.1_pkg 5.23% <90.32%> (+0.04%) ⬆️
mac_6000.1_project 68.04% <100.00%> (+0.01%) ⬆️
mac_6000.2_pkg 5.23% <90.32%> (+0.04%) ⬆️
mac_6000.2_project 68.04% <100.00%> (+0.01%) ⬆️
mac_trunk_pkg 5.23% <90.32%> (+0.04%) ⬆️
mac_trunk_project 68.04% <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.32% <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.11% <100.00%> (+0.01%) ⬆️
win_trunk_pkg 5.24% <90.32%> (+0.04%) ⬆️
win_trunk_project 68.11% <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% <ø> (ø)
🚀 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

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