Reposting bug report from github: 10007
navigator.getGamepads is undefined in IE11, which stops the engine from working.
Setting that to just return an empty array then leads to issues with wheel events, with the error “Unable to find input 7 for device Mouse in slot 0” issued on every scroll event. This means wheel events aren’t working at all for IE11.
I briefly looked at the code but couldn’t see anything obvious as to why that is happening.
I am however unsure as to why getGamepads is called so often.
It’s called in DeviceInputSystem._updateDevice
which has the comment that the function updates devices every frame.This however isn’t the case. The function is called from DeviceInputSystem.pollInput, which in turn is called from InputManager, up to 11 times, per input change!! (And looking at this, it might be multiple times for some inputs). Just moving the mouse over the scene for one of my projects leads to getGamepads being called more than 100 times per frame, for a scene which has no intention of handling gamepad inputs at all.
Surely checking gamepad state should happen once per frame (as the comment implies), and just loop over all connected gamepads (which are stored, so no need to even call getGamepads), instead of checking (multiple times) if every single input event (all of which from what I can see are pointer or keyboard events) is from a gamepad.
I’m curious what the rationale behind using the device input system (pr here) is, seeing as for the general use case of mouse and keyboard events on the web, it seems to add a lot of convolution and indirection.
@Deltakosh I will say here that I’m disappointed in the attitude towards opening issues directly on github. It seems like you want github to only be the domain of core members. I can understand wanting questions and general discussion to occur on the forums here, but to disallow bug reports without first going via the forum goes a bit far.
It is far harder to search for bugs on the forum to see if something has already been reported, and even harder to find if it’s been resolved, and impossible to do so at a glance. There is no distinction on the forum between open and closed issues.
Furthermore you alienate developers by closing issues in such a manner, and put off potential contributors. How many such closed issues don’t end up on the forums at all, and therefore aren’t looked into. If I didn’t repost this issue here, would the problem just continue to exist until someone else stumbled across it? Pretty much all developers have github accounts, and are used to using github. Github is designed for exactly this use case, and should be used as such.