You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Fix Input.is_joy_known response for SDL joypads
This commit is contained in:
@@ -656,10 +656,16 @@ void Input::joy_connection_changed(int p_idx, bool p_connected, const String &p_
|
||||
int mapping = fallback_mapping;
|
||||
// Bypass the mapping system if the joypad's mapping is already handled by its driver
|
||||
// (for example, the SDL joypad driver).
|
||||
if (!p_joypad_info.get("mapping_handled", false)) {
|
||||
if (p_joypad_info.get("mapping_handled", false)) {
|
||||
js.is_known = true;
|
||||
} else {
|
||||
for (int i = 0; i < map_db.size(); i++) {
|
||||
if (js.uid == map_db[i].uid) {
|
||||
mapping = i;
|
||||
if (mapping != fallback_mapping) {
|
||||
js.is_known = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1859,13 +1865,7 @@ void Input::set_fallback_mapping(const String &p_guid) {
|
||||
|
||||
//platforms that use the remapping system can override and call to these ones
|
||||
bool Input::is_joy_known(int p_device) {
|
||||
if (joy_names.has(p_device)) {
|
||||
int mapping = joy_names[p_device].mapping;
|
||||
if (mapping != -1 && mapping != fallback_mapping) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return joy_names.has(p_device) && joy_names[p_device].is_known;
|
||||
}
|
||||
|
||||
String Input::get_joy_guid(int p_device) const {
|
||||
|
||||
Reference in New Issue
Block a user