From 5f0d5b76bbd74f2de7b2e1e9c40a2db46d888d3d Mon Sep 17 00:00:00 2001 From: Neil Enns Date: Wed, 4 Dec 2024 15:48:08 -0800 Subject: [PATCH 1/3] Use an array of InstanceNames --- Joysticks/honeycomb_alpha.joystick.json | 2 +- Joysticks/honeycomb_bravo.joystick.json | 2 +- Joysticks/mfjoystick.schema.json | 17 +++++++++++++++-- Joysticks/octavi.joystick.json | 2 +- .../s_tecs_modern_throttle_max.joystick.json | 2 +- ..._tecs_modern_throttle_max_stem.joystick.json | 2 +- ...odern_throttle_max_stem_fsm_ga.joystick.json | 2 +- .../s_tecs_modern_throttle_mini.joystick.json | 2 +- ...tecs_modern_throttle_mini_plus.joystick.json | 2 +- ..._tecs_modern_throttle_standard.joystick.json | 2 +- ..._modern_throttle_standard_stem.joystick.json | 2 +- Joysticks/saitek_aviator_stick.joystick.json | 2 +- Joysticks/t.a320_pilot.joystick.json | 2 +- .../vkbsim_gladiator_evo_f14.joystick.json | 2 +- .../vkbsim_gladiator_evo_kg12.joystick.json | 2 +- Joysticks/vkbsim_gladiator_evo_l.joystick.json | 2 +- .../vkbsim_gladiator_evo_l_sem.joystick.json | 2 +- .../vkbsim_gladiator_evo_ot_l.joystick.json | 2 +- .../vkbsim_gladiator_evo_ot_l_sem.joystick.json | 2 +- .../vkbsim_gladiator_evo_ot_r.joystick.json | 2 +- .../vkbsim_gladiator_evo_ot_r_sem.joystick.json | 2 +- Joysticks/vkbsim_gladiator_evo_r.joystick.json | 2 +- .../vkbsim_gladiator_evo_r_fsm_ga.joystick.json | 2 +- .../vkbsim_gladiator_evo_r_sem.joystick.json | 2 +- ...sim_gladiator_evo_r_sem_fsm_ga.joystick.json | 2 +- ...vkbsim_gladiator_evo_r_sem_thq.joystick.json | 2 +- ...bsim_gladiator_evo_r_sem_thqx2.joystick.json | 2 +- .../vkbsim_gladiator_evo_r_thq.joystick.json | 2 +- .../vkbsim_gladiator_evo_r_thqx2.joystick.json | 2 +- .../vkbsim_gladiator_nxt_f14.joystick.json | 2 +- .../vkbsim_gladiator_nxt_kg12.joystick.json | 2 +- Joysticks/vkbsim_gladiator_nxt_l.joystick.json | 2 +- .../vkbsim_gladiator_nxt_l_sem.joystick.json | 2 +- .../vkbsim_gladiator_nxt_ot_l.joystick.json | 2 +- .../vkbsim_gladiator_nxt_ot_l_sem.joystick.json | 2 +- .../vkbsim_gladiator_nxt_ot_r.joystick.json | 2 +- .../vkbsim_gladiator_nxt_ot_r_sem.joystick.json | 2 +- Joysticks/vkbsim_gladiator_nxt_r.joystick.json | 2 +- .../vkbsim_gladiator_nxt_r_fsm_ga.joystick.json | 2 +- .../vkbsim_gladiator_nxt_r_sem.joystick.json | 2 +- ...sim_gladiator_nxt_r_sem_fsm_ga.joystick.json | 2 +- ...vkbsim_gladiator_nxt_r_sem_thq.joystick.json | 2 +- ...bsim_gladiator_nxt_r_sem_thqx2.joystick.json | 2 +- .../vkbsim_gladiator_nxt_r_thq.joystick.json | 2 +- .../vkbsim_gladiator_nxt_r_thqx2.joystick.json | 2 +- Joysticks/vkbsim_nxt_fsm_ga.joystick.json | 2 +- Joysticks/vkbsim_nxt_sem.joystick.json | 2 +- Joysticks/vkbsim_nxt_sem_thq.joystick.json | 2 +- Joysticks/vkbsim_nxt_sem_thqx2.joystick.json | 2 +- .../vkbsim_nxt_sem_thqx2_fsm_ga.joystick.json | 2 +- Joysticks/vkbsim_nxt_sem_thqx3.joystick.json | 2 +- Joysticks/vkbsim_nxt_thq.joystick.json | 2 +- Joysticks/vkbsim_nxt_thqx2_fsm_ga.joystick.json | 2 +- Joysticks/vkbsim_nxt_thqx3_fsm_ga.joystick.json | 2 +- Joysticks/winwing_fcu.joystick.json | 2 +- Joysticks/winwing_fcu_efisl.joystick.json | 2 +- Joysticks/winwing_fcu_efisl_efisr.joystick.json | 2 +- Joysticks/winwing_fcu_efisr.joystick.json | 2 +- MobiFlight/Joysticks/JoystickDefinition.cs | 14 +++++++++++++- MobiFlight/Joysticks/JoystickManager.cs | 2 +- 60 files changed, 86 insertions(+), 61 deletions(-) diff --git a/Joysticks/honeycomb_alpha.joystick.json b/Joysticks/honeycomb_alpha.joystick.json index ace47f329..e020a6364 100644 --- a/Joysticks/honeycomb_alpha.joystick.json +++ b/Joysticks/honeycomb_alpha.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "Alpha Flight Controls", + "InstanceNames": ["Alpha Flight Controls"], "Inputs": [ { "Id": 1, diff --git a/Joysticks/honeycomb_bravo.joystick.json b/Joysticks/honeycomb_bravo.joystick.json index 345bbdbce..ab50535fa 100644 --- a/Joysticks/honeycomb_bravo.joystick.json +++ b/Joysticks/honeycomb_bravo.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "Bravo Throttle Quadrant", + "InstanceNames": ["Bravo Throttle Quadrant"], "VendorId": "0x294B", "ProductId": "0x1901", "Inputs": [ diff --git a/Joysticks/mfjoystick.schema.json b/Joysticks/mfjoystick.schema.json index a2a1848a3..53879cd53 100644 --- a/Joysticks/mfjoystick.schema.json +++ b/Joysticks/mfjoystick.schema.json @@ -4,7 +4,7 @@ "$id": "https://mobiflight.com/hid.schema.json", "title": "Root", "type": "object", - "required": ["InstanceName"], + "required": ["InstanceNames"], "dependentRequired": { "Outputs": ["VendorId", "ProductId"] }, @@ -13,7 +13,20 @@ "$id": "#root/InstanceName", "title": "InstanceName", "type": "string", - "description": "Instance name for the device. Required. This is used to match the definition with a connected device." + "description": "Instance name for the device. Obsolete. Use InstanceNames instead." + }, + "InstanceNames": { + "$id": "#root/InstanceNames", + "title": "InstanceNames", + "description": "List of instance names for the device. Required.", + "type": "array", + "default": [], + "items": { + "$id": "#root/Inputs/items", + "title": "Items", + "type": "string", + "description": "A string that identifies a specific joystick device." + } }, "Inputs": { "$id": "#root/Inputs", diff --git a/Joysticks/octavi.joystick.json b/Joysticks/octavi.joystick.json index c285d06c7..3465cf0aa 100644 --- a/Joysticks/octavi.joystick.json +++ b/Joysticks/octavi.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "Octavi", + "InstanceNames": ["Octavi"], "VendorId": "0x04D8", "ProductId": "0xE6D6", "Inputs": [ diff --git a/Joysticks/s_tecs_modern_throttle_max.joystick.json b/Joysticks/s_tecs_modern_throttle_max.joystick.json index 4e610d939..6bd406a13 100644 --- a/Joysticks/s_tecs_modern_throttle_max.joystick.json +++ b/Joysticks/s_tecs_modern_throttle_max.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "S-TECS MODERN THROTTLE MAX", + "InstanceNames": ["S-TECS MODERN THROTTLE MAX"], "VendorId": "0x231D", "ProductId": "0x012E", "Inputs": [ diff --git a/Joysticks/s_tecs_modern_throttle_max_stem.joystick.json b/Joysticks/s_tecs_modern_throttle_max_stem.joystick.json index 22ec9c38d..2b3441b62 100644 --- a/Joysticks/s_tecs_modern_throttle_max_stem.joystick.json +++ b/Joysticks/s_tecs_modern_throttle_max_stem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "S-TECS MODERN THROTTLE MAX STEM", + "InstanceNames": ["S-TECS MODERN THROTTLE MAX STEM"], "VendorId": "0x231D", "ProductId": "0x012E", "Inputs": [ diff --git a/Joysticks/s_tecs_modern_throttle_max_stem_fsm_ga.joystick.json b/Joysticks/s_tecs_modern_throttle_max_stem_fsm_ga.joystick.json index 126ef1e1b..e060b1efb 100644 --- a/Joysticks/s_tecs_modern_throttle_max_stem_fsm_ga.joystick.json +++ b/Joysticks/s_tecs_modern_throttle_max_stem_fsm_ga.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "S-TECS MODERN THROTTLE MAX STEM FSM.GA", + "InstanceNames": ["S-TECS MODERN THROTTLE MAX STEM FSM.GA"], "VendorId": "0x231D", "ProductId": "0x012E", "Inputs": [ diff --git a/Joysticks/s_tecs_modern_throttle_mini.joystick.json b/Joysticks/s_tecs_modern_throttle_mini.joystick.json index c668a5025..e642e0df0 100644 --- a/Joysticks/s_tecs_modern_throttle_mini.joystick.json +++ b/Joysticks/s_tecs_modern_throttle_mini.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "S-TECS MODERN THROTTLE MINI", + "InstanceNames": ["S-TECS MODERN THROTTLE MINI"], "VendorId": "0x231D", "ProductId": "0x012B", "Inputs": [ diff --git a/Joysticks/s_tecs_modern_throttle_mini_plus.joystick.json b/Joysticks/s_tecs_modern_throttle_mini_plus.joystick.json index 02c065b8d..2a696d46b 100644 --- a/Joysticks/s_tecs_modern_throttle_mini_plus.joystick.json +++ b/Joysticks/s_tecs_modern_throttle_mini_plus.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "S-TECS MODERN THROTTLE MINI PLUS", + "InstanceNames": ["S-TECS MODERN THROTTLE MINI PLUS"], "VendorId": "0x231D", "ProductId": "0x012C", "Inputs": [ diff --git a/Joysticks/s_tecs_modern_throttle_standard.joystick.json b/Joysticks/s_tecs_modern_throttle_standard.joystick.json index f98fe42e4..9d9d014f8 100644 --- a/Joysticks/s_tecs_modern_throttle_standard.joystick.json +++ b/Joysticks/s_tecs_modern_throttle_standard.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "S-TECS MODERN THROTTLE STANDARD", + "InstanceNames": ["S-TECS MODERN THROTTLE STANDARD"], "VendorId": "0x231D", "ProductId": "0x012D", "Inputs": [ diff --git a/Joysticks/s_tecs_modern_throttle_standard_stem.joystick.json b/Joysticks/s_tecs_modern_throttle_standard_stem.joystick.json index c93bd3a72..dc37e4e90 100644 --- a/Joysticks/s_tecs_modern_throttle_standard_stem.joystick.json +++ b/Joysticks/s_tecs_modern_throttle_standard_stem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "S-TECS MODERN THROTTLE STANDARD STEM", + "InstanceNames": ["S-TECS MODERN THROTTLE STANDARD STEM"], "VendorId": "0x231D", "ProductId": "0x012D", "Inputs": [ diff --git a/Joysticks/saitek_aviator_stick.joystick.json b/Joysticks/saitek_aviator_stick.joystick.json index 9b7639542..43dcedfe7 100644 --- a/Joysticks/saitek_aviator_stick.joystick.json +++ b/Joysticks/saitek_aviator_stick.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "Saitek Aviator Stick", + "InstanceNames": ["Saitek Aviator Stick"], "VendorId": 1699, "ProductId": 1121, "Inputs": [ diff --git a/Joysticks/t.a320_pilot.joystick.json b/Joysticks/t.a320_pilot.joystick.json index b3af315d8..3e73555db 100644 --- a/Joysticks/t.a320_pilot.joystick.json +++ b/Joysticks/t.a320_pilot.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "T.A320 Pilot", + "InstanceNames": ["T.A320 Pilot"], "VendorId": "0x044F", "ProductId": "0x0405", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_f14.joystick.json b/Joysticks/vkbsim_gladiator_evo_f14.joystick.json index 210d8a303..436c4ceba 100644 --- a/Joysticks/vkbsim_gladiator_evo_f14.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_f14.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO F14", + "InstanceNames": ["VKBsim Gladiator EVO F14"], "VendorId": "0x231D", "ProductId": "0x0A00", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_kg12.joystick.json b/Joysticks/vkbsim_gladiator_evo_kg12.joystick.json index 1b99341dc..75beb1c48 100644 --- a/Joysticks/vkbsim_gladiator_evo_kg12.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_kg12.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO KG12", + "InstanceNames": ["VKBsim Gladiator EVO KG12"], "VendorId": "0x231D", "ProductId": "0x0600", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_l.joystick.json b/Joysticks/vkbsim_gladiator_evo_l.joystick.json index 15d403f50..f760dcf9d 100644 --- a/Joysticks/vkbsim_gladiator_evo_l.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_l.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO L", + "InstanceNames": ["VKBsim Gladiator EVO L"], "VendorId": "0x231D", "ProductId": "0x0201", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_l_sem.joystick.json b/Joysticks/vkbsim_gladiator_evo_l_sem.joystick.json index 807de0ca7..d16a928d2 100644 --- a/Joysticks/vkbsim_gladiator_evo_l_sem.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_l_sem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO L SEM", + "InstanceNames": ["VKBsim Gladiator EVO L SEM"], "VendorId": "0x231D", "ProductId": "0x0205", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_ot_l.joystick.json b/Joysticks/vkbsim_gladiator_evo_ot_l.joystick.json index ac97ac976..372c90781 100644 --- a/Joysticks/vkbsim_gladiator_evo_ot_l.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_ot_l.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO OT L", + "InstanceNames": ["VKBsim Gladiator EVO OT L"], "VendorId": "0x231D", "ProductId": "0x3201", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_ot_l_sem.joystick.json b/Joysticks/vkbsim_gladiator_evo_ot_l_sem.joystick.json index d7210bef9..3f2a372c2 100644 --- a/Joysticks/vkbsim_gladiator_evo_ot_l_sem.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_ot_l_sem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO OT L SEM", + "InstanceNames": ["VKBsim Gladiator EVO OT L SEM"], "VendorId": "0x231D", "ProductId": "0x3205", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_ot_r.joystick.json b/Joysticks/vkbsim_gladiator_evo_ot_r.joystick.json index 4e3213083..b0fb60c5b 100644 --- a/Joysticks/vkbsim_gladiator_evo_ot_r.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_ot_r.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO OT R", + "InstanceNames": ["VKBsim Gladiator EVO OT R"], "VendorId": "0x231D", "ProductId": "0x3200", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_ot_r_sem.joystick.json b/Joysticks/vkbsim_gladiator_evo_ot_r_sem.joystick.json index b4d8d8ceb..7d00ccd69 100644 --- a/Joysticks/vkbsim_gladiator_evo_ot_r_sem.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_ot_r_sem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO OT R SEM", + "InstanceNames": ["VKBsim Gladiator EVO OT R SEM"], "VendorId": "0x231D", "ProductId": "0x3204", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_r.joystick.json b/Joysticks/vkbsim_gladiator_evo_r.joystick.json index 21755e425..0c6dfaec9 100644 --- a/Joysticks/vkbsim_gladiator_evo_r.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_r.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO R", + "InstanceNames": ["VKBsim Gladiator EVO R"], "VendorId": "0x231D", "ProductId": "0x0200", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_r_fsm_ga.joystick.json b/Joysticks/vkbsim_gladiator_evo_r_fsm_ga.joystick.json index 8de67edfb..9616635dd 100644 --- a/Joysticks/vkbsim_gladiator_evo_r_fsm_ga.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_r_fsm_ga.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO R FSM.GA", + "InstanceNames": ["VKBsim Gladiator EVO R FSM.GA"], "VendorId": "0x231D", "ProductId": "0x0220", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_r_sem.joystick.json b/Joysticks/vkbsim_gladiator_evo_r_sem.joystick.json index 194aecfcf..600d7d545 100644 --- a/Joysticks/vkbsim_gladiator_evo_r_sem.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_r_sem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO R SEM", + "InstanceNames": ["VKBsim Gladiator EVO R SEM"], "VendorId": "0x231D", "ProductId": "0x0204", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_r_sem_fsm_ga.joystick.json b/Joysticks/vkbsim_gladiator_evo_r_sem_fsm_ga.joystick.json index dfb955bc2..a421ef18e 100644 --- a/Joysticks/vkbsim_gladiator_evo_r_sem_fsm_ga.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_r_sem_fsm_ga.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO R SEM FSM.GA", + "InstanceNames": ["VKBsim Gladiator EVO R SEM FSM.GA"], "VendorId": "0x231D", "ProductId": "0x0224", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_r_sem_thq.joystick.json b/Joysticks/vkbsim_gladiator_evo_r_sem_thq.joystick.json index a77d8d678..97ea1ba65 100644 --- a/Joysticks/vkbsim_gladiator_evo_r_sem_thq.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_r_sem_thq.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO R SEM THQ", + "InstanceNames": ["VKBsim Gladiator EVO R SEM THQ"], "VendorId": "0x231D", "ProductId": "0x0214", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_r_sem_thqx2.joystick.json b/Joysticks/vkbsim_gladiator_evo_r_sem_thqx2.joystick.json index ed9b1b183..62d446bc7 100644 --- a/Joysticks/vkbsim_gladiator_evo_r_sem_thqx2.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_r_sem_thqx2.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO R SEM THQx2", + "InstanceNames": ["VKBsim Gladiator EVO R SEM THQx2"], "VendorId": "0x231D", "ProductId": "0x0224", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_r_thq.joystick.json b/Joysticks/vkbsim_gladiator_evo_r_thq.joystick.json index 92ecaf259..d85064755 100644 --- a/Joysticks/vkbsim_gladiator_evo_r_thq.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_r_thq.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO R THQ", + "InstanceNames": ["VKBsim Gladiator EVO R THQ"], "VendorId": "0x231D", "ProductId": "0x0210", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_evo_r_thqx2.joystick.json b/Joysticks/vkbsim_gladiator_evo_r_thqx2.joystick.json index 71d9dcca2..d0e03ed61 100644 --- a/Joysticks/vkbsim_gladiator_evo_r_thqx2.joystick.json +++ b/Joysticks/vkbsim_gladiator_evo_r_thqx2.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator EVO R THQx2", + "InstanceNames": ["VKBsim Gladiator EVO R THQx2"], "VendorId": "0x231D", "ProductId": "0x0220", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_f14.joystick.json b/Joysticks/vkbsim_gladiator_nxt_f14.joystick.json index a0e704631..4ac0d8ed3 100644 --- a/Joysticks/vkbsim_gladiator_nxt_f14.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_f14.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT F14", + "InstanceNames": ["VKBsim Gladiator NXT F14"], "VendorId": "0x231D", "ProductId": "0x0A00", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_kg12.joystick.json b/Joysticks/vkbsim_gladiator_nxt_kg12.joystick.json index 8d18a069d..000e05aea 100644 --- a/Joysticks/vkbsim_gladiator_nxt_kg12.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_kg12.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT KG12", + "InstanceNames": ["VKBsim Gladiator NXT KG12"], "VendorId": "0x231D", "ProductId": "0x0600", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_l.joystick.json b/Joysticks/vkbsim_gladiator_nxt_l.joystick.json index 0f5c4f172..e1e9722e7 100644 --- a/Joysticks/vkbsim_gladiator_nxt_l.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_l.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT L", + "InstanceNames": ["VKBsim Gladiator NXT L"], "VendorId": "0x231D", "ProductId": "0x0201", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_l_sem.joystick.json b/Joysticks/vkbsim_gladiator_nxt_l_sem.joystick.json index b04f87500..7c67d9fdb 100644 --- a/Joysticks/vkbsim_gladiator_nxt_l_sem.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_l_sem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT L SEM", + "InstanceNames": ["VKBsim Gladiator NXT L SEM"], "VendorId": "0x231D", "ProductId": "0x0205", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_ot_l.joystick.json b/Joysticks/vkbsim_gladiator_nxt_ot_l.joystick.json index 8dd9f749d..0a462d349 100644 --- a/Joysticks/vkbsim_gladiator_nxt_ot_l.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_ot_l.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT OT L", + "InstanceNames": ["VKBsim Gladiator NXT OT L"], "VendorId": "0x231D", "ProductId": "0x3201", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_ot_l_sem.joystick.json b/Joysticks/vkbsim_gladiator_nxt_ot_l_sem.joystick.json index 17ae3a115..fff6562cf 100644 --- a/Joysticks/vkbsim_gladiator_nxt_ot_l_sem.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_ot_l_sem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT OT L SEM", + "InstanceNames": ["VKBsim Gladiator NXT OT L SEM"], "VendorId": "0x231D", "ProductId": "0x3205", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_ot_r.joystick.json b/Joysticks/vkbsim_gladiator_nxt_ot_r.joystick.json index e56945acf..b70b3ee42 100644 --- a/Joysticks/vkbsim_gladiator_nxt_ot_r.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_ot_r.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT OT R", + "InstanceNames": ["VKBsim Gladiator NXT OT R"], "VendorId": "0x231D", "ProductId": "0x3200", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_ot_r_sem.joystick.json b/Joysticks/vkbsim_gladiator_nxt_ot_r_sem.joystick.json index a4fa55360..e24bb5213 100644 --- a/Joysticks/vkbsim_gladiator_nxt_ot_r_sem.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_ot_r_sem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT OT R SEM", + "InstanceNames": ["VKBsim Gladiator NXT OT R SEM"], "VendorId": "0x231D", "ProductId": "0x3204", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_r.joystick.json b/Joysticks/vkbsim_gladiator_nxt_r.joystick.json index 5c97148de..0a6ee8322 100644 --- a/Joysticks/vkbsim_gladiator_nxt_r.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_r.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT R", + "InstanceNames": ["VKBsim Gladiator NXT R"], "VendorId": "0x231D", "ProductId": "0x0200", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_r_fsm_ga.joystick.json b/Joysticks/vkbsim_gladiator_nxt_r_fsm_ga.joystick.json index 5173bcb32..7f8c16aa3 100644 --- a/Joysticks/vkbsim_gladiator_nxt_r_fsm_ga.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_r_fsm_ga.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT R FSM.GA", + "InstanceNames": ["VKBsim Gladiator NXT R FSM.GA"], "VendorId": "0x231D", "ProductId": "0x0220", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_r_sem.joystick.json b/Joysticks/vkbsim_gladiator_nxt_r_sem.joystick.json index b85ff2830..4cff12a5b 100644 --- a/Joysticks/vkbsim_gladiator_nxt_r_sem.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_r_sem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT R SEM", + "InstanceNames": ["VKBsim Gladiator NXT R SEM"], "VendorId": "0x231D", "ProductId": "0x0204", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_r_sem_fsm_ga.joystick.json b/Joysticks/vkbsim_gladiator_nxt_r_sem_fsm_ga.joystick.json index a57abfc9e..1c96506f8 100644 --- a/Joysticks/vkbsim_gladiator_nxt_r_sem_fsm_ga.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_r_sem_fsm_ga.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT R SEM FSM.GA", + "InstanceNames": ["VKBsim Gladiator NXT R SEM FSM.GA"], "VendorId": "0x231D", "ProductId": "0x0224", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_r_sem_thq.joystick.json b/Joysticks/vkbsim_gladiator_nxt_r_sem_thq.joystick.json index 88ff11988..5c723394b 100644 --- a/Joysticks/vkbsim_gladiator_nxt_r_sem_thq.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_r_sem_thq.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT R SEM THQ", + "InstanceNames": ["VKBsim Gladiator NXT R SEM THQ"], "VendorId": "0x231D", "ProductId": "0x0214", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_r_sem_thqx2.joystick.json b/Joysticks/vkbsim_gladiator_nxt_r_sem_thqx2.joystick.json index e332a49c6..0f0c413b7 100644 --- a/Joysticks/vkbsim_gladiator_nxt_r_sem_thqx2.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_r_sem_thqx2.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT R SEM THQx2", + "InstanceNames": ["VKBsim Gladiator NXT R SEM THQx2"], "VendorId": "0x231D", "ProductId": "0x0224", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_r_thq.joystick.json b/Joysticks/vkbsim_gladiator_nxt_r_thq.joystick.json index fcc223267..e0078cd43 100644 --- a/Joysticks/vkbsim_gladiator_nxt_r_thq.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_r_thq.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT R THQ", + "InstanceNames": ["VKBsim Gladiator NXT R THQ"], "VendorId": "0x231D", "ProductId": "0x0210", "Inputs": [ diff --git a/Joysticks/vkbsim_gladiator_nxt_r_thqx2.joystick.json b/Joysticks/vkbsim_gladiator_nxt_r_thqx2.joystick.json index 79f9291fb..658c5ee64 100644 --- a/Joysticks/vkbsim_gladiator_nxt_r_thqx2.joystick.json +++ b/Joysticks/vkbsim_gladiator_nxt_r_thqx2.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBsim Gladiator NXT R THQx2", + "InstanceNames": ["VKBsim Gladiator NXT R THQx2"], "VendorId": "0x231D", "ProductId": "0x0220", "Inputs": [ diff --git a/Joysticks/vkbsim_nxt_fsm_ga.joystick.json b/Joysticks/vkbsim_nxt_fsm_ga.joystick.json index 24b480d98..3f7e6ac1c 100644 --- a/Joysticks/vkbsim_nxt_fsm_ga.joystick.json +++ b/Joysticks/vkbsim_nxt_fsm_ga.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBSim NXT FSM.GA", + "InstanceNames": ["VKBSim NXT FSM.GA"], "VendorId": "0x231D", "ProductId": "0x2220", "Inputs": [ diff --git a/Joysticks/vkbsim_nxt_sem.joystick.json b/Joysticks/vkbsim_nxt_sem.joystick.json index c2ff59676..6066c7f5b 100644 --- a/Joysticks/vkbsim_nxt_sem.joystick.json +++ b/Joysticks/vkbsim_nxt_sem.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBSim NXT SEM", + "InstanceNames": ["VKBSim NXT SEM"], "VendorId": "0x231D", "ProductId": "0x2204", "Inputs": [ diff --git a/Joysticks/vkbsim_nxt_sem_thq.joystick.json b/Joysticks/vkbsim_nxt_sem_thq.joystick.json index dd2c4a214..8faa13f77 100644 --- a/Joysticks/vkbsim_nxt_sem_thq.joystick.json +++ b/Joysticks/vkbsim_nxt_sem_thq.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBSim NXT SEM THQ", + "InstanceNames": ["VKBSim NXT SEM THQ"], "VendorId": "0x231D", "ProductId": "0x2214", "Inputs": [ diff --git a/Joysticks/vkbsim_nxt_sem_thqx2.joystick.json b/Joysticks/vkbsim_nxt_sem_thqx2.joystick.json index 784054962..217742ec3 100644 --- a/Joysticks/vkbsim_nxt_sem_thqx2.joystick.json +++ b/Joysticks/vkbsim_nxt_sem_thqx2.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBSim NXT SEM THQx2", + "InstanceNames": ["VKBSim NXT SEM THQx2"], "VendorId": "0x231D", "ProductId": "0x2224", "Inputs": [ diff --git a/Joysticks/vkbsim_nxt_sem_thqx2_fsm_ga.joystick.json b/Joysticks/vkbsim_nxt_sem_thqx2_fsm_ga.joystick.json index 92e57bc58..2628ac01e 100644 --- a/Joysticks/vkbsim_nxt_sem_thqx2_fsm_ga.joystick.json +++ b/Joysticks/vkbsim_nxt_sem_thqx2_fsm_ga.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBSim NXT SEM THQx2 FSM.GA", + "InstanceNames": ["VKBSim NXT SEM THQx2 FSM.GA"], "VendorId": "0x231D", "ProductId": "0x2224", "Inputs": [ diff --git a/Joysticks/vkbsim_nxt_sem_thqx3.joystick.json b/Joysticks/vkbsim_nxt_sem_thqx3.joystick.json index 7a7695279..f622ba305 100644 --- a/Joysticks/vkbsim_nxt_sem_thqx3.joystick.json +++ b/Joysticks/vkbsim_nxt_sem_thqx3.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBSim NXT SEM THQx3", + "InstanceNames": ["VKBSim NXT SEM THQx3"], "VendorId": "0x231D", "ProductId": "0x2234", "Inputs": [ diff --git a/Joysticks/vkbsim_nxt_thq.joystick.json b/Joysticks/vkbsim_nxt_thq.joystick.json index 110dbb768..8eadd858e 100644 --- a/Joysticks/vkbsim_nxt_thq.joystick.json +++ b/Joysticks/vkbsim_nxt_thq.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBSim NXT THQ", + "InstanceNames": ["VKBSim NXT THQ"], "VendorId": "0x231D", "ProductId": "0x2210", "Inputs": [ diff --git a/Joysticks/vkbsim_nxt_thqx2_fsm_ga.joystick.json b/Joysticks/vkbsim_nxt_thqx2_fsm_ga.joystick.json index b9f5c2210..0cdabe088 100644 --- a/Joysticks/vkbsim_nxt_thqx2_fsm_ga.joystick.json +++ b/Joysticks/vkbsim_nxt_thqx2_fsm_ga.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBSim NXT THQx2 FSM.GA", + "InstanceNames": ["VKBSim NXT THQx2 FSM.GA"], "VendorId": "0x231D", "ProductId": "0x2220", "Inputs": [ diff --git a/Joysticks/vkbsim_nxt_thqx3_fsm_ga.joystick.json b/Joysticks/vkbsim_nxt_thqx3_fsm_ga.joystick.json index bf5b15788..d2d295197 100644 --- a/Joysticks/vkbsim_nxt_thqx3_fsm_ga.joystick.json +++ b/Joysticks/vkbsim_nxt_thqx3_fsm_ga.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "VKBSim NXT THQx3 FSM.GA", + "InstanceNames": ["VKBSim NXT THQx3 FSM.GA"], "VendorId": "0x231D", "ProductId": "0x2230", "Inputs": [ diff --git a/Joysticks/winwing_fcu.joystick.json b/Joysticks/winwing_fcu.joystick.json index 44dca71c8..4f299444d 100644 --- a/Joysticks/winwing_fcu.joystick.json +++ b/Joysticks/winwing_fcu.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "WINWING FCU", + "InstanceNames": ["WINWING FCU"], "VendorId": "0x4098", "ProductId": "0xBB10", "Inputs": [ diff --git a/Joysticks/winwing_fcu_efisl.joystick.json b/Joysticks/winwing_fcu_efisl.joystick.json index 057341ff6..530314d03 100644 --- a/Joysticks/winwing_fcu_efisl.joystick.json +++ b/Joysticks/winwing_fcu_efisl.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "WINWING FCU-320 + EFIS-320L", + "InstanceNames": ["WINWING FCU-320 + EFIS-320L"], "VendorId": "0x4098", "ProductId": "0xBC1D", "Inputs": [ diff --git a/Joysticks/winwing_fcu_efisl_efisr.joystick.json b/Joysticks/winwing_fcu_efisl_efisr.joystick.json index a1578e260..71fbc4725 100644 --- a/Joysticks/winwing_fcu_efisl_efisr.joystick.json +++ b/Joysticks/winwing_fcu_efisl_efisr.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "WINWING FCU-320 + EFIS-320L + EFIS-320R", + "InstanceNames": ["WINWING FCU-320 + EFIS-320L + EFIS-320R"], "VendorId": "0x4098", "ProductId": "0xBA01", "Inputs": [ diff --git a/Joysticks/winwing_fcu_efisr.joystick.json b/Joysticks/winwing_fcu_efisr.joystick.json index 0fb78f76c..732a8ceb0 100644 --- a/Joysticks/winwing_fcu_efisr.joystick.json +++ b/Joysticks/winwing_fcu_efisr.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceName": "WINWING FCU-320 + EFIS-320R", + "InstanceNames": ["WINWING FCU-320 + EFIS-320R"], "VendorId": "0x4098", "ProductId": "0xBC1E", "Inputs": [ diff --git a/MobiFlight/Joysticks/JoystickDefinition.cs b/MobiFlight/Joysticks/JoystickDefinition.cs index 5f5a7f97c..3764c7a2a 100644 --- a/MobiFlight/Joysticks/JoystickDefinition.cs +++ b/MobiFlight/Joysticks/JoystickDefinition.cs @@ -67,6 +67,11 @@ public class JoystickDefinition : IMigrateable /// public string InstanceName; + /// + /// Instance names for the device. This is used to match the definition with a connected device. + /// + public List InstanceNames = new List(); + /// /// List of options supported by the device. /// @@ -98,6 +103,13 @@ public JoystickInput FindInputByName(string name) /// /// Migrates values from a prior version of the JSON schema to the newest version. /// - public void Migrate() { } + public void Migrate() { + + // Migrate a single InstanceName to a list of InstanceNames + if (this.InstanceName != null) + { + this.InstanceNames.Add(this.InstanceName); + } + } } } diff --git a/MobiFlight/Joysticks/JoystickManager.cs b/MobiFlight/Joysticks/JoystickManager.cs index 9f9c77806..6ac20ec6f 100644 --- a/MobiFlight/Joysticks/JoystickManager.cs +++ b/MobiFlight/Joysticks/JoystickManager.cs @@ -51,7 +51,7 @@ public JoystickManager() /// The first definition matching the instanceMae, or null if none found. private JoystickDefinition GetDefinitionByInstanceName(String instanceName) { - return Definitions.Find(definition => definition.InstanceName == instanceName); + return Definitions.Find(definition => definition.InstanceNames.Contains(instanceName)); } /// From 2ba9f532edd7b5ec5c1eb5770d99627efa1cc8fb Mon Sep 17 00:00:00 2001 From: Neil Enns Date: Wed, 4 Dec 2024 15:55:41 -0800 Subject: [PATCH 2/3] Add obselete attribute --- MobiFlight/Joysticks/JoystickDefinition.cs | 3 +++ MobiFlight/Joysticks/JoystickManager.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/MobiFlight/Joysticks/JoystickDefinition.cs b/MobiFlight/Joysticks/JoystickDefinition.cs index 3764c7a2a..695d29984 100644 --- a/MobiFlight/Joysticks/JoystickDefinition.cs +++ b/MobiFlight/Joysticks/JoystickDefinition.cs @@ -65,6 +65,7 @@ public class JoystickDefinition : IMigrateable /// /// Instance name for the device. This is used to match the definition with a connected device. /// + [Obsolete("Use InstanceNames list property instead.")] public string InstanceName; /// @@ -106,10 +107,12 @@ public JoystickInput FindInputByName(string name) public void Migrate() { // Migrate a single InstanceName to a list of InstanceNames +#pragma warning disable CS0618 // Type or member is obsolete if (this.InstanceName != null) { this.InstanceNames.Add(this.InstanceName); } +#pragma warning restore CS0618 // Type or member is obsolete } } } diff --git a/MobiFlight/Joysticks/JoystickManager.cs b/MobiFlight/Joysticks/JoystickManager.cs index 6ac20ec6f..19b073179 100644 --- a/MobiFlight/Joysticks/JoystickManager.cs +++ b/MobiFlight/Joysticks/JoystickManager.cs @@ -71,7 +71,7 @@ private JoystickDefinition GetDefinitionByProductId(int vendorId, int productId) public void LoadDefinitions() { Definitions = JsonBackedObject.LoadDefinitions(Directory.GetFiles("Joysticks", "*.joystick.json"), "Joysticks/mfjoystick.schema.json", - onSuccess: (joystick, definitionFile) => Log.Instance.log($"Loaded joystick definition for {joystick.InstanceName}", LogSeverity.Info), + onSuccess: (joystick, definitionFile) => Log.Instance.log($"Loaded joystick definition for {String.Join(", ", joystick.InstanceNames)}", LogSeverity.Info), onError: () => LoadingError = true ); } From 6f3d5683e1f8a90f368f38b7b3d6115bcf7d0046 Mon Sep 17 00:00:00 2001 From: Neil Enns Date: Wed, 4 Dec 2024 15:59:09 -0800 Subject: [PATCH 3/3] Tweak obsolete code, add new winwing instance --- Joysticks/winwing_fcu.joystick.json | 2 +- MobiFlight/Joysticks/JoystickDefinition.cs | 5 +++++ MobiFlight/Joysticks/JoystickManager.cs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Joysticks/winwing_fcu.joystick.json b/Joysticks/winwing_fcu.joystick.json index 4f299444d..a5824963b 100644 --- a/Joysticks/winwing_fcu.joystick.json +++ b/Joysticks/winwing_fcu.joystick.json @@ -1,6 +1,6 @@ { "$schema": "./mfjoystick.schema.json", - "InstanceNames": ["WINWING FCU"], + "InstanceNames": [ "WINWING FCU", "WINWING FCU-320" ], "VendorId": "0x4098", "ProductId": "0xBB10", "Inputs": [ diff --git a/MobiFlight/Joysticks/JoystickDefinition.cs b/MobiFlight/Joysticks/JoystickDefinition.cs index 695d29984..ceb53b112 100644 --- a/MobiFlight/Joysticks/JoystickDefinition.cs +++ b/MobiFlight/Joysticks/JoystickDefinition.cs @@ -114,5 +114,10 @@ public void Migrate() { } #pragma warning restore CS0618 // Type or member is obsolete } + + public override string ToString() + { + return String.Join(", ", this.InstanceNames); + } } } diff --git a/MobiFlight/Joysticks/JoystickManager.cs b/MobiFlight/Joysticks/JoystickManager.cs index 19b073179..4ac2d8c81 100644 --- a/MobiFlight/Joysticks/JoystickManager.cs +++ b/MobiFlight/Joysticks/JoystickManager.cs @@ -71,7 +71,7 @@ private JoystickDefinition GetDefinitionByProductId(int vendorId, int productId) public void LoadDefinitions() { Definitions = JsonBackedObject.LoadDefinitions(Directory.GetFiles("Joysticks", "*.joystick.json"), "Joysticks/mfjoystick.schema.json", - onSuccess: (joystick, definitionFile) => Log.Instance.log($"Loaded joystick definition for {String.Join(", ", joystick.InstanceNames)}", LogSeverity.Info), + onSuccess: (joystick, definitionFile) => Log.Instance.log($"Loaded joystick definition for {joystick}", LogSeverity.Info), onError: () => LoadingError = true ); }