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

Feature/mobile key codes #4326

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

Conversation

BogdanTheGeek
Copy link

Description:

Add support for android gamepad(or tv remote) keycodes. These are basically required for apps running on android TV.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@BogdanTheGeek
Copy link
Author

For now, I have only added and tested the dpad keys to get some feedback.
I have tested these on an android phone with an xbox controller and on a fire tv stick with the included remote.

@lostdusty
Copy link

+1 for this feature.

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Thanks so much for this, a great addition.
We should consider adding support for DPad into the focus manager so the apps are traversable on a TV device. But this PR enables such work so let's land it :).

I had wondered if this needed to be "gamepad support" in the API but I think this probably just falls to documentation.

Talking of which I think the costs in driver/mobile/key.go need appropriate documentation and it should include:

//
// Since: 2.5

to mark when they were added. I think I missed this for KeyBack last release!

@andydotxyz
Copy link
Member

Thanks for looking at this - a great approach to starting gamepad support. I think it needs a bit of docs as noted inline but neat solution.

@BogdanTheGeek
Copy link
Author

Thanks for looking at this - a great approach to starting gamepad support. I think it needs a bit of docs as noted inline but neat solution.

Should I also add the remaining supported keycodes(Gamepad, play/pause, camera etc?) to this PR?
I am not sure how these would be supported on other platforms like Linux, Mac, iOS. I assume, the same keycode to key name lookup is implemented for all other platforms. If pointed in the right direction, I can add them for Mac and Linux, the only other ones I can test on.

@andydotxyz
Copy link
Member

There are a few assumptions thrown in there. What is a camera or play/pause button on a desktop?
As it's in mobile right now all we need to test is Android and iOS (though I'm not sure how you hook up the dpad to an iOS device - but we should try and figure it out!)

@BogdanTheGeek
Copy link
Author

There are a few assumptions thrown in there. What is a camera or play/pause button on a desktop? As it's in mobile right now all we need to test is Android and iOS (though I'm not sure how you hook up the dpad to an iOS device - but we should try and figure it out!)

you can connect any bluetooth remote or gamepad to any desktop or mobile device and get the same key events.

@BogdanTheGeek
Copy link
Author

@andydotxyz anything else required to merge this?

@andydotxyz
Copy link
Member

you can connect any bluetooth remote or gamepad to any desktop or mobile device and get the same key events.

Then maybe this isn't mobile specific after all? If it's expected that this should work on all platforms then maybe landing it in mobile space was not the right approach - apologies if it was my assumption

@andydotxyz anything else required to merge this?

I guess it needs to have complete support for whatever platforms should be supported. If it is mobile specific then the iOS driver looks to be missing code. If however it's not mobile specific (as in above message) then maybe it needs to be revised for working-anyway codes?

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.

None yet

3 participants