Skip to content

Controller not recognized as gamepad #503

@KyleNBurke

Description

@KyleNBurke

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions