File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -100,8 +100,20 @@ pub fn controllers() -> Result<Vec<Controller>> {
100
100
}
101
101
}
102
102
103
- for device_info in hidapi. device_list ( ) {
103
+ let mut unique_devices: Vec < _ > = hidapi. device_list ( ) . collect ( ) ;
104
+ unique_devices. dedup_by ( |a, b| a. serial_number ( ) == b. serial_number ( ) ) ;
105
+ for device_info in unique_devices {
104
106
match ( device_info. vendor_id ( ) , device_info. product_id ( ) ) {
107
+ ( playstation:: DS_VENDOR_ID , playstation:: DS3_PRODUCT_ID ) => {
108
+ debug ! ( "Found DualShock3 controller: {:?}" , device_info) ;
109
+ let controller = playstation:: parse_dualshock3_controller_data (
110
+ device_info,
111
+ & hidapi,
112
+ "DualShock3" ,
113
+ ) ?;
114
+
115
+ controllers. push ( controller) ;
116
+ }
105
117
( playstation:: DS_VENDOR_ID , playstation:: DS_PRODUCT_ID ) => {
106
118
debug ! ( "Found DualSense controller: {:?}" , device_info) ;
107
119
let controller = playstation:: parse_dualsense_controller_data (
You can’t perform that action at this time.
0 commit comments