-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: main
Are you sure you want to change the base?
Add Gamepad vibrationActuator API to web-sys #4098
Conversation
There was a problem hiding this 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!
The API that currently exists in the repo has been deprecated and the new API has been added. This allows gamepads to be rumbled Spec: https://w3c.github.io/gamepad/ More details: rustwasm#4089
9718a4d
to
0296a06
Compare
@daxpedda thanks for the guidance! I just pushed up a new commit with that change and addressed a merge conflict with the |
There was a problem hiding this 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!
interface GamepadHapticActuator | ||
{ | ||
[RustDeprecated] | ||
readonly attribute GamepadHapticActuatorType type; | ||
[Throws, NewObject, RustDeprecated] | ||
Promise<boolean> pulse(double value, double duration); |
There was a problem hiding this comment.
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.
[RustDeprecated] | ||
enum GamepadHapticActuatorType { | ||
"vibration" | ||
}; |
There was a problem hiding this comment.
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.
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!