Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds gamepad support by implementing bindings to the W3C Gamepad API. It provides functions to query the number of connected gamepads, check connection status, read button states, and read analog axis values.
- Adds Rust FFI declarations for gamepad functions in the WASM native module
- Implements corresponding JavaScript functions that interface with the browser's Gamepad API
- Supports up to 4 gamepads with standard button/axis mappings
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/native/wasm.rs | Adds extern "C" declarations for four gamepad-related functions with documentation |
| js/gl.js | Implements the JavaScript gamepad functions that query the browser's navigator.getGamepads() API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I would rather keep it in a pluging instead of adding it to core miniquad. For native platforms I used https://github.com/not-fl3/quad-gamepad, but there are so many different ways to communicate with gamepads and its all so opionated. I would consider just starting a new miniquad JS plugin crate with the implementation proposed in this PR. |
|
Okay |
What it says on the tin