- WIP 3rd party controllers
This commit is contained in:
parent
e1f3e573fd
commit
ecfa890c75
3 changed files with 9 additions and 5 deletions
|
@ -89,6 +89,8 @@ namespace BetterJoyForCemu {
|
|||
foreach (SController v in a.Items) {
|
||||
if (v == null)
|
||||
continue;
|
||||
if (v.name == null)
|
||||
continue;
|
||||
if (v.name.Equals(manu))
|
||||
return true;
|
||||
}
|
||||
|
@ -98,11 +100,12 @@ namespace BetterJoyForCemu {
|
|||
private void RefreshControllerList() {
|
||||
list_allControllers.Items.Clear();
|
||||
IntPtr ptr = HIDapi.hid_enumerate(0x0, 0x0);
|
||||
IntPtr top_ptr = ptr;
|
||||
|
||||
hid_device_info enumerate; // Add device to list
|
||||
while (ptr != IntPtr.Zero) {
|
||||
enumerate = (hid_device_info)Marshal.PtrToStructure(ptr, typeof(hid_device_info));
|
||||
|
||||
// TODO: try checking against interface number instead
|
||||
if (!ContainsText(list_customControllers, enumerate.product_string) && !ContainsText(list_allControllers, enumerate.product_string)) {
|
||||
list_allControllers.Items.Add(new SController(enumerate.product_string, enumerate.vendor_id, enumerate.product_id, 0));
|
||||
// 0 type is undefined
|
||||
|
@ -110,6 +113,7 @@ namespace BetterJoyForCemu {
|
|||
|
||||
ptr = enumerate.next;
|
||||
}
|
||||
HIDapi.hid_free_enumeration(top_ptr);
|
||||
}
|
||||
|
||||
private void btn_add_Click(object sender, EventArgs e) {
|
||||
|
|
|
@ -271,12 +271,12 @@ namespace BetterJoyForCemu {
|
|||
|
||||
if (showAsXInput) {
|
||||
out_xbox = new OutputControllerXbox360();
|
||||
out_xbox.FeedbackReceived += ReceiveRumble;
|
||||
if (toRumble)
|
||||
out_xbox.FeedbackReceived += ReceiveRumble;
|
||||
}
|
||||
|
||||
if (showAsDS4) {
|
||||
out_ds4 = new OutputControllerDualShock4();
|
||||
|
||||
if (toRumble)
|
||||
out_ds4.FeedbackReceived += Ds4_FeedbackReceived;
|
||||
}
|
||||
|
|
|
@ -120,11 +120,11 @@ namespace BetterJoyForCemu {
|
|||
SController thirdParty = null;
|
||||
enumerate = (hid_device_info)Marshal.PtrToStructure(ptr, typeof(hid_device_info));
|
||||
|
||||
if (enumerate.serial_number == null) {
|
||||
/*if (enumerate.serial_number == null) {
|
||||
ptr = enumerate.next; // can't believe it took me this long to figure out why USB connections used up so much CPU.
|
||||
// it was getting stuck in an inf loop here!
|
||||
continue;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (form.nonOriginal) {
|
||||
enumerate.product_id = product_pro;
|
||||
|
|
Loading…
Add table
Reference in a new issue