Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
67c9d3e
Added Support for Thrustmaster T.Flight HOTAS 4
WolxStein May 21, 2024
2f1d516
Merge pull request #1 from WolxStein/Flight_HOTAS_4_Support
WolxStein May 21, 2024
3925e78
Implemented Thruster Rudder Control for Flight HOTAS 4
WolxStein Jun 2, 2024
250ee1f
Merge pull request #2 from WolxStein/Flight_HOTAS_4_Support
WolxStein Jun 2, 2024
6c71a9b
Imported System
WolxStein Jun 2, 2024
0301b69
Merge pull request #3 from WolxStein/Flight_HOTAS_4_Support
WolxStein Jun 2, 2024
e5af65d
Update README.md
WolxStein Jun 2, 2024
976e373
Update README.md
WolxStein Jun 2, 2024
7146279
Update Form1.Designer.cs
WolxStein Jun 2, 2024
3e329a7
Merge pull request #4 from WolxStein/Flight_HOTAS_4_Support
WolxStein Jun 2, 2024
bdc3f40
Update README.md
WolxStein Jun 2, 2024
7575935
Flight HOTAS 1 & Thrustmaster T.Flight Rudder
WolxStein Jun 22, 2024
ba6d9f3
Merge pull request #5 from WolxStein/Flight_HOTAS_1-&-T.Flight-Rudder
WolxStein Jun 22, 2024
e5b46bd
Update README.md
WolxStein Jun 22, 2024
8dfee24
Thrustmaster T.Flight Stick X Camera Bug Fix
WolxStein Jul 6, 2024
0527ba8
Merge pull request #6 from WolxStein/Thrustmaster-T.Flight-Stick-X-ca…
WolxStein Jul 6, 2024
d7b67d2
Created Logitech 3D Pro Mirrored
WolxStein Jul 6, 2024
e0f3ff4
Merge branch 'master' of https://github.com/WolxStein/JoystickVisualizer
WolxStein Jul 6, 2024
3b85ae5
Merge Fix for Logitech3DPro
WolxStein Jul 6, 2024
dfb9f08
Thrustmaster T16000M Duo in JoystickVisualizer
WolxStein Jul 6, 2024
2dde1a4
Merge pull request #7 from WolxStein/Thrustmaster-T16000M-Duo
WolxStein Jul 6, 2024
f050fdc
Model Selector in Joystick Proxy
WolxStein Jul 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion JoystickProxyWin/Joystick Proxy/ControllerDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public bool Enabled

public DeviceInstance DeviceInstance { get => _deviceInstance; }
public bool Supported { get; internal set; }
public Dictionary<string, string> AlterModels { get => _alterModels; }
public string SelectedModelUsbId { get => _selectedModelUsbId; set => _selectedModelUsbId = value; }

private DeviceInstance _deviceInstance;
private Joystick _joystick;
Expand All @@ -38,11 +40,16 @@ public bool Enabled
private bool _enabled = false;
private bool NotPollable = false;

public ControllerDevice(DirectInput di, DeviceInstance deviceInstance)
private Dictionary<string, string> _alterModels;
private string _selectedModelUsbId;

public ControllerDevice(DirectInput di, DeviceInstance deviceInstance, Dictionary<string, string> alterModels = null)
{
_deviceInstance = deviceInstance;
_usbId = ProductGuidToUSBID(_deviceInstance.ProductGuid);
_joystick = new Joystick(di, deviceInstance.InstanceGuid);
_alterModels = alterModels;
_selectedModelUsbId = _usbId;

Joystick.Properties.BufferSize = 32;
}
Expand Down
193 changes: 103 additions & 90 deletions JoystickProxyWin/Joystick Proxy/Form1.Designer.cs

Large diffs are not rendered by default.

94 changes: 92 additions & 2 deletions JoystickProxyWin/Joystick Proxy/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
Expand All @@ -23,6 +24,7 @@ public partial class Form1 : Form

private BindingList<ControllerDevice> _devices;
private BindingList<ControllerInput> _input;
//private BindingList<ControllerDevice> _alterDevices;

private Socket _socket;
private IPEndPoint _endPoint;
Expand All @@ -41,16 +43,90 @@ public Form1()

_devices = new BindingList<ControllerDevice>();
_input = new BindingList<ControllerInput>();
//_alterDevices = new BindingList<ControllerDevice>();

InitializeComponent();

ControllerDeviceBindingSource.DataSource = _devices;
InputBindingSource.DataSource = _input;
//AlternateDeviceBindingSource.DataSource = _alterDevices;

VisualizerHostTextBox.Text = Properties.Settings.Default.Host;
PortInput.Value = Properties.Settings.Default.Port;

ScanJoysticks();

DataGridViewComboBoxColumn modelColumn = new DataGridViewComboBoxColumn();
modelColumn.HeaderText = "Model";
modelColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
modelColumn.Name = "ModelComboBoxColumn";
modelColumn.FillWeight = 30F;
modelColumn.Width = 300;
modelColumn.DisplayMember = "Device_Name";
modelColumn.ValueMember = "Device_USB_ID";
modelColumn.ReadOnly = false;
DevicesDataGridView.Columns.Add(modelColumn);

DevicesDataGridView.RowsAdded += UpdateAlterModelsHandler;
DevicesDataGridView.RowsRemoved += UpdateAlterModelsHandler;
DevicesDataGridView.EditingControlShowing += EditingControlShowingHandler;
}

private void UpdateAlterModelsHandler(object sender, DataGridViewRowsRemovedEventArgs e)
{
UpdateAlterModels();
}

private void UpdateAlterModelsHandler(object sender, DataGridViewRowsAddedEventArgs e)
{
UpdateAlterModels();
}

private void UpdateAlterModels()
{
foreach (DataGridViewRow row in DevicesDataGridView.Rows)
{
DataGridViewComboBoxCell comboBoxCell = (DataGridViewComboBoxCell)row.Cells["ModelComboBoxColumn"];
ControllerDevice cellDevice = (ControllerDevice)row.DataBoundItem;

comboBoxCell.DataSource = cellDevice.AlterModels.Select(m => new { Device_USB_ID = m.Key, Device_Name = m.Value }).ToList();

if (cellDevice.AlterModels.Any(m => m.Key == cellDevice.UsbId))
{
comboBoxCell.Value = cellDevice.UsbId;
}
else
{
comboBoxCell.Value = null;
}
}
}
private void EditingControlShowingHandler(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (DevicesDataGridView.CurrentCell.ColumnIndex == DevicesDataGridView.Columns["ModelComboBoxColumn"].Index &&
e.Control is ComboBox comboBox)
{
// Remove the existing event handler to avoid duplicate calls
comboBox.SelectedIndexChanged -= ModelColumn_SelectedIndexChangedHandler;
// Attach the event handler
comboBox.SelectedIndexChanged += ModelColumn_SelectedIndexChangedHandler;
}
}

private void ModelColumn_SelectedIndexChangedHandler(object sender, EventArgs e)
{
if (sender is ComboBox comboBox)
{
DataGridViewComboBoxEditingControl editingControl = comboBox as DataGridViewComboBoxEditingControl;
DataGridView dataGridView = editingControl.EditingControlDataGridView;
int rowIndex = dataGridView.CurrentCell.RowIndex;
ControllerDevice cellDevice = (ControllerDevice)dataGridView.Rows[rowIndex].DataBoundItem;

if (comboBox.SelectedValue != null)
{
cellDevice.SelectedModelUsbId = comboBox.SelectedValue.ToString();
}
}
}

private void UpdateEndpoint(string host, int port)
Expand Down Expand Up @@ -107,7 +183,21 @@ private void ScanJoysticks()
if (_devices.Where(d => d.DeviceInstance.InstanceGuid == deviceInstance.InstanceGuid).Count() == 0)
{
if (ShowAllDevicesCheckBox.Checked == true || SupportedDevices.ContainsKey(ControllerDevice.ProductGuidToUSBID(deviceInstance.ProductGuid)))
addedDevices.Add(new ControllerDevice(_directInput, deviceInstance));
{
Dictionary<string, string> alterModels = new Dictionary<string, string>();
foreach (KeyValuePair<string, string> devices in SupportedDevices)
{
/*if ((devices.Value.ToLower().Contains("joystick") && deviceInstance.InstanceName.ToLower().Contains("joystick")) ||
(devices.Value.ToLower().Contains("throttle") && deviceInstance.InstanceName.ToLower().Contains("throttle")) ||
(devices.Value.ToLower().Contains("hotas") && deviceInstance.InstanceName.ToLower().Contains("hotas")) ||
(devices.Value.ToLower().Contains("pedals") && deviceInstance.InstanceName.ToLower().Contains("pedals")))
{*/
alterModels.Add(devices.Key, devices.Value);
//}
}
addedDevices.Add(new ControllerDevice(_directInput, deviceInstance, alterModels));

}
}
}

Expand Down Expand Up @@ -191,7 +281,7 @@ private void SendEvent(ControllerDevice device, string e)
id = "046d:c215";
}

string outgoingString = String.Format("{0},{1},{2}", id, device.Name, e);
string outgoingString = String.Format("{0},{1},{2}", device.SelectedModelUsbId, device.AlterModels[device.SelectedModelUsbId], e);

if (supportedDevice)
{
Expand Down
13 changes: 8 additions & 5 deletions JoystickProxyWin/Joystick Proxy/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ControllerDeviceBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
<value>180, 17</value>
</metadata>
<metadata name="RefreshDevicesTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>238, 17</value>
<value>399, 17</value>
</metadata>
<metadata name="InputName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
Expand All @@ -130,13 +130,16 @@
<value>True</value>
</metadata>
<metadata name="InputBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>403, 17</value>
<value>562, 17</value>
</metadata>
<metadata name="ReadInputTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>562, 17</value>
<value>721, 17</value>
</metadata>
<metadata name="SaveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>701, 17</value>
<value>859, 17</value>
</metadata>
<metadata name="form1BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
Expand Down
1 change: 1 addition & 0 deletions JoystickProxyWin/Joystick Proxy/Joystick Proxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<Compile Include="Settings.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down
25 changes: 15 additions & 10 deletions JoystickProxyWin/Joystick Proxy/settings.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
[Devices]
044f:b10a = Thrustmaster T.16000M
044f:b10a = Thrustmaster T.16000M Joystick
044f:b10a left= Thrustmaster T.16000M Left Joystick
044f:b10a right= Thrustmaster T.16000M Right Joystick
044f:b687 = Thrustmaster T.16000M Throttle
044f:b678 = Thrustmaster T.Flight Rudder Car Mode
044f:b679 = Thrustmaster T.Flight Rudder
044f:b106 = Thrustmaster T.Flight Joystick X
044f:b108 = Thrustmaster T.Flight HOTAS X
044f:b68d = Thrustmaster T.Flight HOTAS 1
044f:b67c = Thrustmaster T.Flight HOTAS 4
044f:0402 = Thrustmaster Warthog Joystick
044f:0404 = Thrustmaster Warthog Throttle
044f:ffff = Thrustmaster Warthog Combined
06a3:0763 = Saitek Rudder Pedals
06a3:0764 = Saitek Combat Rudder Pedals
068e:c0f2 = CH Pro Pedals
068e:00f2 = CH Pro Pedals
231d:011f = VKB Gunfighter
046d:c212 = Logitech Extreme 3D Pro
046d:c215 = Logitech 3D Pro
16d0:0a38 = MFG Crosswind
231d:011f = VKB Gunfighter Joystick
046d:c212 = Logitech Extreme 3D Pro Joystick
046d:c215 = Logitech 3D Pro Joystick
16d0:0a38 = MFG Crosswind Pedals
06a3:075c = Saitek X52 HOTAS
06a3:0762 = Saitek X52 Pro HOTAS
0738:a215 = Saitek X55 Throttle
Expand All @@ -24,8 +29,8 @@
06a3:0c2d = Saitek Pro Flight Throttle Quadrant
06a3:2541 = Saitek X45 HOTAS (2541)
06a3:053c = Saitek X45 HOTAS (053c)
06a3:0464 = Saitek Cyborg Evo
03eb:2043 = Virpil Mongoos T-50
03ef:2004 = VPC-Star-Citizen-L
03ec:2005 = VPC-Star-Citizen-R
044f:b68f = Thrustmaster Pendular Rudder
06a3:0464 = Saitek Cyborg Evo Joystick
03eb:2043 = Virpil Mongoos T-50 Joystick
03ef:2004 = VPC-Star-Citizen-L Joystick
03ec:2005 = VPC-Star-Citizen-R Joystick
044f:b68f = Thrustmaster Pendular Rudder Pedals
6 changes: 6 additions & 0 deletions JoystickVisualizer/.vsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
Binary file modified JoystickVisualizer/Assets/JoystickVisualizerSettings.lighting
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Loading