You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
fix: use productCategory instead of vendorName for joy name on macos
This commit is contained in:
@@ -503,7 +503,13 @@ void JoypadApple::add_joypad(GCController *p_controller) {
|
||||
}
|
||||
|
||||
// Tell Godot about our new controller.
|
||||
Input::get_singleton()->joy_connection_changed(joy_id, true, String::utf8(p_controller.vendorName.UTF8String));
|
||||
char const *device_name;
|
||||
if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) {
|
||||
device_name = p_controller.productCategory.UTF8String;
|
||||
} else {
|
||||
device_name = p_controller.vendorName.UTF8String;
|
||||
}
|
||||
Input::get_singleton()->joy_connection_changed(joy_id, true, String::utf8(device_name));
|
||||
|
||||
// Assign our player index.
|
||||
joypads.insert(joy_id, memnew(GameController(joy_id, p_controller)));
|
||||
|
||||
Reference in New Issue
Block a user