Can't read mouse from firefox
Moderator: Moderators
Can't read mouse from firefox
I'm trying to add 3d mouse support to my web app. On Chrome it works fine, but firefox is not detecting the 3d mouse as a gamepad.
Re: Can't read mouse from firefox
Hi zacaj,
What sort of web program? Is it a 3D visualisation program?
Similarly to your experience, we have also found Gamepad API to be lacking in terms of browser support and wider acceptance.
What sort of web program? Is it a 3D visualisation program?
Similarly to your experience, we have also found Gamepad API to be lacking in terms of browser support and wider acceptance.
-
- Posts: 5
- Joined: Wed Mar 25, 2020 8:05 am
Re: Can't read mouse from firefox
[*]In Firefox, gamepads are only exposed to a page when the user interacts with one with the page visible. This helps prevent gamepads being used for fingerprinting the user. Once one gamepad has been interacted with, other gamepads that are connected will automatically be visible.
You can use gamepadconnected like this:
Each gamepad has a unique ID associated with it, which is available on the event's gamepad property.
You can use gamepadconnected like this:
Code: Select all
window.addEventListener("gamepadconnected", function(e) {
console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.",
e.gamepad.index, e.gamepad.id,
e.gamepad.buttons.length, e.gamepad.axes.length);
});