|
@@ -113,6 +113,7 @@ void Input::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("get_joy_axis", "device", "axis"), &Input::get_joy_axis);
|
|
ClassDB::bind_method(D_METHOD("get_joy_axis", "device", "axis"), &Input::get_joy_axis);
|
|
ClassDB::bind_method(D_METHOD("get_joy_name", "device"), &Input::get_joy_name);
|
|
ClassDB::bind_method(D_METHOD("get_joy_name", "device"), &Input::get_joy_name);
|
|
ClassDB::bind_method(D_METHOD("get_joy_guid", "device"), &Input::get_joy_guid);
|
|
ClassDB::bind_method(D_METHOD("get_joy_guid", "device"), &Input::get_joy_guid);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_joy_info", "device"), &Input::get_joy_info);
|
|
ClassDB::bind_method(D_METHOD("should_ignore_device", "vendor_id", "product_id"), &Input::should_ignore_device);
|
|
ClassDB::bind_method(D_METHOD("should_ignore_device", "vendor_id", "product_id"), &Input::should_ignore_device);
|
|
ClassDB::bind_method(D_METHOD("get_connected_joypads"), &Input::get_connected_joypads);
|
|
ClassDB::bind_method(D_METHOD("get_connected_joypads"), &Input::get_connected_joypads);
|
|
ClassDB::bind_method(D_METHOD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength);
|
|
ClassDB::bind_method(D_METHOD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength);
|
|
@@ -437,11 +438,12 @@ static String _hex_str(uint8_t p_byte) {
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-void Input::joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid) {
|
|
|
|
|
|
+void Input::joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid, Dictionary p_joypad_info) {
|
|
_THREAD_SAFE_METHOD_
|
|
_THREAD_SAFE_METHOD_
|
|
Joypad js;
|
|
Joypad js;
|
|
js.name = p_connected ? p_name : "";
|
|
js.name = p_connected ? p_name : "";
|
|
js.uid = p_connected ? p_guid : "";
|
|
js.uid = p_connected ? p_guid : "";
|
|
|
|
+ js.info = p_connected ? p_joypad_info : Dictionary();
|
|
|
|
|
|
if (p_connected) {
|
|
if (p_connected) {
|
|
String uidname = p_guid;
|
|
String uidname = p_guid;
|
|
@@ -1499,6 +1501,11 @@ String Input::get_joy_guid(int p_device) const {
|
|
return joy_names[p_device].uid;
|
|
return joy_names[p_device].uid;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+Dictionary Input::get_joy_info(int p_device) const {
|
|
|
|
+ ERR_FAIL_COND_V(!joy_names.has(p_device), Dictionary());
|
|
|
|
+ return joy_names[p_device].info;
|
|
|
|
+}
|
|
|
|
+
|
|
bool Input::should_ignore_device(int p_vendor_id, int p_product_id) const {
|
|
bool Input::should_ignore_device(int p_vendor_id, int p_product_id) const {
|
|
uint32_t full_id = (((uint32_t)p_vendor_id) << 16) | ((uint16_t)p_product_id);
|
|
uint32_t full_id = (((uint32_t)p_vendor_id) << 16) | ((uint16_t)p_product_id);
|
|
return ignored_device_ids.has(full_id);
|
|
return ignored_device_ids.has(full_id);
|