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

Controller not recognized as gamepad #503

Open
KyleNBurke opened this issue May 20, 2022 · 2 comments
Open

Controller not recognized as gamepad #503

KyleNBurke opened this issue May 20, 2022 · 2 comments

Comments

@KyleNBurke
Copy link

I have a standard Xbox One controller plugged into my PC but it's not being recognized as a gamepad even though the mapping for it is defined in the GLFW source.

Here is the code I'm running.

let mut glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();
let joystick = glfw.get_joystick(glfw::JoystickId::Joystick1);

println!("{}", joystick.get_guid().unwrap());
println!("{}", joystick.is_gamepad());

get_guid() returns 78696e70757401000000000000000000 and is_gamepad() returns false which is strange because I can see that exact GUID defined in the GLFW source at the links below.
https://github.com/glfw/glfw/blob/201400b974b63eb7f23eb7d8563589df9c699d7c/src/mappings.h.in#L65
https://github.com/glfw/glfw/blob/201400b974b63eb7f23eb7d8563589df9c699d7c/src/mappings.h#L422

Also, it's the literal GUID mentioned in the documentation below. Search the page for that GUID.
https://www.glfw.org/docs/3.3/input_guide.html#joystick

So why is .is_gamepad() returning false?

@DeciStudios
Copy link

Did you ever figure this out?

@KyleNBurke
Copy link
Author

KyleNBurke commented Mar 16, 2024

@DeciStudios
I did not. What I can say thought is, I've been using the Odin programming language with it's GLFW bindings and haven't ran into this issue. I do get true from the gamepad check procedure. So if you or anyone else is is still seeing this issue, I believe it to be an issue with this bindings library, not GLFW itself.

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