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

web-sys Missing method #1143

Closed
danielyule opened this issue Jan 2, 2019 · 3 comments
Closed

web-sys Missing method #1143

danielyule opened this issue Jan 2, 2019 · 3 comments

Comments

@danielyule
Copy link

I'm trying to write a library that includes support for gamepads via the Navigator interface. The gamepad object is supported. but navigator.getGamepads() isn't (https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getGamepads). The method is in the webidl file:https://github.com/rustwasm/wasm-bindgen/blob/master/crates/web-sys/webidls/enabled/Navigator.webidl#L167 but it doesn't show up in the docs (https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Navigator.html) and trying to use it from my code results in a compilation error, even though I have enabled both the Navigator and Gamepad features in my crate's features.

The methods immediately before and after getGamepads() in the webidl file are present and usable, and I can't see any reason why they would be there but getGamepads() wouldn't. The only difference I can see is that getGamepads() returns a sequence of nullable objects, which I don't see many other examples of. I briefly looked at the web-idl compiler and nothing jumped out at me as handling this case differently, but it's very likely I overlooked something.

Can anyone give my guidance as to why this method would not be present?

@Pauan
Copy link
Contributor

Pauan commented Jan 2, 2019

Probably related to #1038, #1036, #1043, and #1077.

@danielyule
Copy link
Author

Indeed, this seems to be a duplicate of #1038. I thought I had verified that sequences were supported, since getVRDisplays() was present and it also returned a sequence, but that sequence was wrapped in a Promise, which masked it.

@richard-uk1
Copy link
Contributor

Sequences will be in the next release @danielyule : #1152

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

No branches or pull requests

3 participants