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

Multiple input devices cause issues with Keyboard input #44

Open
whoisryosuke opened this issue Jun 17, 2022 · 1 comment
Open

Multiple input devices cause issues with Keyboard input #44

whoisryosuke opened this issue Jun 17, 2022 · 1 comment

Comments

@whoisryosuke
Copy link

whoisryosuke commented Jun 17, 2022

Great library! been stress testing it recently and noticed some issues. might be my setup since I'm in React-land, but thought it'd be good to point out since it's reproducible.

I have an issue where the device keeps competing with gamepad, and when I use a key on keyboard, it doesn’t get picked up until the device is recognized — then I press key again to see input. I also see the gamepad as a “new device” right after my keyboard each time I press a key.

This only happens after using a gamepad. If start with keyboard, I have no issues. But once there’s 2 input, the keyboard input becomes “lagged” (aka requiring 1 key press to activate again). Every single time though — so I press, it finds device, press again, key works, press again, it has to find device again… Hard refreshing page fixes this until gamepad is used again.

You can see an example of the logs here in this screenshot:
Screenshot of keyboard and gamepad device found logs in Chrome's devtools - sorry if picbun loses this

Or try running the example here - I'm using a PlayStation DualShock 4 and a standard keyboard:
https://codesandbox.io/s/github/whoisryosuke/r3f-experiments/tree/f391624b2a9e1f24e7a78b6751c6e95efb63b5a4

The code is here on Github for reference (so you don't have to CSB everytime):
https://github.com/whoisryosuke/r3f-experiments/tree/f391624b2a9e1f24e7a78b6751c6e95efb63b5a4

Input stuff happens here:
Controller init + input mapping
React component for input (aka update())
Using the input for moving the "player"

@hmans
Copy link
Owner

hmans commented Jun 18, 2022

Hi, thanks for your issue! The README should have a warning about this, but this library is still extremely WIP and should not be used in production projects. One of the next steps for the library is a complete rewrite that will provide a significantly more solid foundation for many things (including multi-device handling, which is currently very basic, and admittedly quite a bit wonky). It still be quite some time before I get to this, though, because I'm currently focusing on my work around three-vfx.

I recommed that you watch this repo for new releases so you get notified when things are picking up again. Thanks for your patience!

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

2 participants