Show VID/PIDs to user

This commit is contained in:
Ash 2017-04-13 13:00:35 +10:00
parent db27368d31
commit 39e8459840
5 changed files with 7 additions and 7 deletions

View File

@ -113,13 +113,13 @@ public class HidController extends Controller {
// TODO: own class for joycons
if (getVID() == 0x57e) {
if (getPID() == 0x2006) {
return "Joy-Con (L) on " + getIdentifier();
return "Joy-Con (L) (57e:2006) on " + getIdentifier();
} else if (getPID() == 0x2007) {
return "Joy-Con (R) on " + getIdentifier();
return "Joy-Con (R) (57e:2007) on " + getIdentifier();
}
}
String name = getHidDevice().getProductString();
return ((name != null) ? name : "USB HID") + " on " + getIdentifier();
return ((name != null) ? name : "USB HID") + " (" + Integer.toHexString((int)getVID() & 0xFFFF) + ":" + Integer.toHexString((int)getPID() & 0xFFFF) + ") on " + getIdentifier();
}
}

View File

@ -195,6 +195,6 @@ public class LinuxDevInputController extends Controller implements Runnable {
@Override
public String getInfoText() {
return ((name != null) ? name : "Linux controller") + " on " + getIdentifier();
return ((name != null) ? name : "Linux controller") + " (" + Integer.toHexString((int)getVID() & 0xFFFF) + ":" + Integer.toHexString((int)getPID() & 0xFFFF) + ") on " + getIdentifier();
}
}

View File

@ -30,6 +30,6 @@ public class XInput13Controller extends XInputController {
@Override
public String getInfoText() {
return "XInput 1.3 on " + getIdentifier();
return "XInput 1.3 (" + Integer.toHexString((int)getVID() & 0xFFFF) + ":" + Integer.toHexString((int)getPID() & 0xFFFF) + ") on " + getIdentifier();
}
}

View File

@ -30,6 +30,6 @@ public class XInput14Controller extends XInputController {
@Override
public String getInfoText() {
return "XInput 1.4 on " + getIdentifier();
return "XInput 1.4 (" + Integer.toHexString((int)getVID() & 0xFFFF) + ":" + Integer.toHexString((int)getPID() & 0xFFFF) + ") on " + getIdentifier();
}
}

View File

@ -139,6 +139,6 @@ public class XInputController extends Controller {
@Override
public String getInfoText() {
return "XInput on " + getIdentifier();
return "XInput (" + Integer.toHexString((int)getVID() & 0xFFFF) + ":" + Integer.toHexString((int)getPID() & 0xFFFF) + ") on " + getIdentifier();
}
}