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

Add Gamepad vibrationActuator API to web-sys #4098

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

Conversation

brettchalupa
Copy link

The API that currently exists in the repo has been deprecated and the
new API has been added.

This allows gamepads to be rumbled.

I tried to follow the instructions in https://github.com/rustwasm/wasm-bindgen/tree/main/crates/web-sys#how-to-add-an-interface as best as I could.

Spec: https://w3c.github.io/gamepad/

More details: #4089

It's not entirely clear to me how to best test this out, but I'm happy to if anyone's able to provide a little guidance. Thanks!

@brettchalupa brettchalupa marked this pull request as ready for review August 29, 2024 16:34
Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

Considering this is a working draft, these new APIs should be unstable.
This works by just moving the WebIDL to the unstable folder.

Otherwise this is great, thank you!

@daxpedda daxpedda added the waiting for author Waiting for author to respond label Sep 7, 2024
@brettchalupa
Copy link
Author

@daxpedda thanks for the guidance! I just pushed up a new commit with that change and addressed a merge conflict with the CHANGELOG.md file

Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

The CI is failing because bindings have to be regenerated.

Please let me know if you have any issues doing that or if anything is unclear!

Comment on lines +37 to +42
interface GamepadHapticActuator
{
[RustDeprecated]
readonly attribute GamepadHapticActuatorType type;
[Throws, NewObject, RustDeprecated]
Promise<boolean> pulse(double value, double duration);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Already stabilized APIs can't simply be made unstable, this would be a breaking change.

Comment on lines +11 to +14
[RustDeprecated]
enum GamepadHapticActuatorType {
"vibration"
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as before, this can't be made unstable without a breaking change anymore.

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

Successfully merging this pull request may close these issues.

2 participants