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

bug: getLastInputDeviceType() doesn't look at gamepad sticks or mouse move #572

Open
dragoncoder047 opened this issue Dec 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working input Related to Input System
Milestone

Comments

@dragoncoder047
Copy link
Contributor

just do

kaplay();
onUpdate(() => debug.log(getLastInputDeviceType()));

then connect a game controller. Press a button, it changes to gamepad. Use the keyboard to change it back to keyboard and then move a stick on the controller, it doesn't change to gamepad. Also, clicking changes it to mouse but moving the mouse does not.

Since mouse move and gamepad stick are "passive", maybe KAPLAY can be set to only look at them for getLastInputDeviceType() if the game attaches a onMouseMove or onGamepadStick handler and ignore these otherwise.

@dragoncoder047
Copy link
Contributor Author

There would be the problem of dead zones with this. You would have to specify a region that is to be considered no input because of stick drift.

@lajbel
Copy link
Collaborator

lajbel commented Jan 4, 2025

We could add an option for it later. Maybe a dynamic way to modify game options? setOptions() and getOptions()?

@lajbel lajbel self-assigned this Jan 20, 2025
@lajbel lajbel added the input Related to Input System label Jan 20, 2025
@lajbel lajbel added this to the 3001.1 milestone Jan 20, 2025
@lajbel lajbel moved this to Todo in KAPLAY.js Bugs Jan 21, 2025
@lajbel lajbel moved this from Todo to In Progress in KAPLAY.js Bugs Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working input Related to Input System
Projects
Status: In Progress
Development

No branches or pull requests

2 participants