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

Gamepad support #52

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

emutavchi
Copy link
Contributor

No description provided.

@emutavchi
Copy link
Contributor Author

This depends on WebPlatformForEmbedded/libwpe#69

@aperezdc
Copy link
Contributor

We have support in the WebKit GTK port to use libmanette for gamepad support, which would already cover some of the TODOs that you have in the code here (like per gamepad mappings, and user-provided custom mappings, too). Most of the code here is basically reimplementing part of libmanette. Wouldn't it make more sense to enable WebKit's support to use libmanette directly? That would avoid needing this patch, and also WebPlatformForEmbedded/libwpe#69 would not be unneeded.

@emutavchi
Copy link
Contributor Author

@aperezdc thank you for looking into this. I'll check if we can use libmanette and get back to you. I'd like to keep this pull request open in the meantime if that is ok. Thanks!

@aperezdc
Copy link
Contributor

@aperezdc thank you for looking into this. I'll check if we can use libmanette and get back to you. I'd like to keep this pull request open in the meantime if that is ok. Thanks!

@emutavchi: No problem at all, we can keep this PR open for now.

Something that I was mulling over this weekend is that with the approach of having an interface in libwpe we can let embedders decide which web view gets the gamepad events directly (by means of their wpe_view_backend), but using the libmanette code in WebKit we would need to provide something in the API anyway to configure which view gets the gamepad events. This might be one point in favor of the libwpe interface. Maybe @zdobersek has some thoughts in this regard.

@emutavchi: Note that even if we end up adding the gamepad interface in libwpe, you might still want to use libmanette in WPEBackend-rdk so you can avoid writing most of the code that actually handles detecting devices, reading input events, remapping buttons (as it includes a mapper), and providing default mappings for many gamepads (libmanette includes a copy of SDL's button mappings database, which seems to be a de facto standard).

@woutermeek
Copy link
Contributor

@emutavchi do we need to keep this PR open?

@emutavchi
Copy link
Contributor Author

Hi, @woutermeek @aperezdc. sorry for the delayed response.

@aperezdc, unfortunately, we cannot use libmanette at the moment due to dependency on the Meson build system. We're in the process of moving to the latest Yocto version. Migration of all devices will take some time. Until then I think it'd be good to have a simple, dependency less implementation.

I'll prepare pull request for wpe-webkit repo showing the usage of the new API and update with the link to PR here.

@emutavchi
Copy link
Contributor Author

WPEWebKitt PR WebPlatformForEmbedded/WPEWebKit#692

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

Successfully merging this pull request may close these issues.

3 participants