mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
remove the generic I/O hack, it's not working reliably
This commit is contained in:
parent
27d345c77c
commit
57419bea8c
@ -11,7 +11,7 @@
|
|||||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||||
|
|
||||||
# Project target.
|
# Project target.
|
||||||
target=android-21
|
target=android-22
|
||||||
android.library.reference.1=libs/appcompat
|
android.library.reference.1=libs/appcompat
|
||||||
android.library=false
|
android.library=false
|
||||||
android.library.reference.2=libs/googleplay
|
android.library.reference.2=libs/googleplay
|
||||||
|
@ -637,28 +637,47 @@ static void handle_hotplug(android_input_t *android,
|
|||||||
else if (strstr(device_name, "SideWinder"))
|
else if (strstr(device_name, "SideWinder"))
|
||||||
strlcpy(name_buf, "SideWinder Classic", sizeof(name_buf));
|
strlcpy(name_buf, "SideWinder Classic", sizeof(name_buf));
|
||||||
}
|
}
|
||||||
/* Make sure generic I/O devices are always bound to port one
|
else if (strstr(device_name, "NVIDIA Corporation NVIDIA Controller v01.01"))
|
||||||
* should be easier to add these instead of one hack per device
|
{
|
||||||
*/
|
/* Built-in shield controller is always user 1 */
|
||||||
else if (strstr(device_name, "Amazon Fire TV Remote")
|
*port = 0;
|
||||||
|| strstr(device_name, "Nexus Remote")
|
strlcpy(name_buf, device_name, sizeof(name_buf));
|
||||||
|| strstr(device_name, "SHIELD Remote")
|
}
|
||||||
|| strstr(device_name, "gpio")
|
else if ((strstr(device_name, "Virtual") ||
|
||||||
|| strstr(device_name, "Virtual"))
|
strstr(device_name, "gpio")) && strstr(android->pad_states[0].name,"NVIDIA Corporation NVIDIA Controller v01.01"))
|
||||||
|
{
|
||||||
|
/* If built-in shield controller is detected bind the virtual and gpio devices to the same port */
|
||||||
|
*port = 0;
|
||||||
|
strlcpy(name_buf, "Generic I/O Device", sizeof(name_buf));
|
||||||
|
}
|
||||||
|
else if (strstr(device_name, "NVIDIA Corporation NVIDIA Controller v01.03") && !strstr(android->pad_states[0].name,"NVIDIA Corporation NVIDIA Controller v01.03"))
|
||||||
{
|
{
|
||||||
*port = 0;
|
*port = 0;
|
||||||
if (strstr(device_name, "Virtual") || (strstr(device_name, "gpio")))
|
strlcpy(name_buf, device_name, sizeof(name_buf));
|
||||||
strlcpy(name_buf, "Generic I/O Device", sizeof(name_buf));
|
}
|
||||||
else
|
else if (strstr(device_name, "Virtual") ||
|
||||||
strlcpy(name_buf, device_name, sizeof(name_buf));
|
(strstr(device_name, "gpio") && strstr(android->pad_states[0].name,"NVIDIA Corporation NVIDIA Controller v01.03")))
|
||||||
|
{
|
||||||
|
/* If the shield controller is detected bind the virtual and gpio devices to the same port*/
|
||||||
|
*port = 0;
|
||||||
|
strlcpy(name_buf, "NVIDIA SHIELD Controller", sizeof(name_buf));
|
||||||
|
}
|
||||||
|
else if (strstr(device_name, "Amazon Fire TV Remote")
|
||||||
|
|| strstr(device_name, "Nexus Remote")
|
||||||
|
|| strstr(device_name, "SHIELD Remote"))
|
||||||
|
{
|
||||||
|
/* hack for remote control type devices, set them always to port 0 */
|
||||||
|
*port = 0;
|
||||||
|
strlcpy(name_buf, device_name, sizeof(name_buf));
|
||||||
}
|
}
|
||||||
else if ( *port==1 && ( strstr(android->pad_states[0].name,"Amazon Fire TV Remote")
|
else if ( *port==1 && ( strstr(android->pad_states[0].name,"Amazon Fire TV Remote")
|
||||||
|| strstr(android->pad_states[0].name,"Nexus Remote")
|
|| strstr(android->pad_states[0].name,"Nexus Remote")
|
||||||
|| strstr(android->pad_states[0].name,"SHIELD Remote")
|
|| strstr(android->pad_states[0].name,"SHIELD Remote")))
|
||||||
|| strstr(android->pad_states[0].name,"Generic I/O Device")))
|
|
||||||
{
|
{
|
||||||
/* then, when binding a new controller in port 1 and one of those remotes
|
/* and then when we are binding a new controller in port 1 and one of those remotes
|
||||||
* was bound to port 0, overwrite that binding
|
* was bound to port 0, bind the device as port 0 too, it causes all the controllers to
|
||||||
|
* rebind on the first button press but at least the remotes can be used to navigate
|
||||||
|
* the user interface
|
||||||
*/
|
*/
|
||||||
*port = 0;
|
*port = 0;
|
||||||
strlcpy(name_buf, device_name, sizeof(name_buf));
|
strlcpy(name_buf, device_name, sizeof(name_buf));
|
||||||
@ -700,10 +719,7 @@ static void handle_hotplug(android_input_t *android,
|
|||||||
settings->input.vid[*port] = params.vid;
|
settings->input.vid[*port] = params.vid;
|
||||||
|
|
||||||
strlcpy(params.driver, android_joypad.ident, sizeof(params.driver));
|
strlcpy(params.driver, android_joypad.ident, sizeof(params.driver));
|
||||||
|
autoconfigured = input_config_autoconfigure_joypad(¶ms);
|
||||||
// Don't try to autoconfigure GPIO devices
|
|
||||||
if (!strstr(android->pad_states[0].name,"Generic I/O Device"))
|
|
||||||
autoconfigured = input_config_autoconfigure_joypad(¶ms);
|
|
||||||
|
|
||||||
if (autoconfigured)
|
if (autoconfigured)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user