private void CMB_joysticks_Click(object sender, EventArgs e) { CMB_joysticks.Items.Clear(); DeviceList joysticklist = Joystick.getDevices(); foreach (DeviceInstance device in joysticklist) { CMB_joysticks.Items.Add(device.ProductName); } if (CMB_joysticks.Items.Count > 0) { CMB_joysticks.SelectedIndex = 0; } }
private void Joystick_Load(object sender, EventArgs e) { try { DeviceList joysticklist = Joystick.getDevices(); foreach (DeviceInstance device in joysticklist) { CMB_joysticks.Items.Add(device.ProductName); } } catch { CustomMessageBox.Show("Error geting joystick list: do you have the directx redist installed?"); this.Close(); return; } if (CMB_joysticks.Items.Count > 0) { CMB_joysticks.SelectedIndex = 0; } CMB_CH1.DataSource = (Enum.GetValues(typeof(Joystick.joystickaxis))); CMB_CH2.DataSource = (Enum.GetValues(typeof(Joystick.joystickaxis))); CMB_CH3.DataSource = (Enum.GetValues(typeof(Joystick.joystickaxis))); CMB_CH4.DataSource = (Enum.GetValues(typeof(Joystick.joystickaxis))); CMB_CH5.DataSource = (Enum.GetValues(typeof(Joystick.joystickaxis))); CMB_CH6.DataSource = (Enum.GetValues(typeof(Joystick.joystickaxis))); CMB_CH7.DataSource = (Enum.GetValues(typeof(Joystick.joystickaxis))); CMB_CH8.DataSource = (Enum.GetValues(typeof(Joystick.joystickaxis))); try { //CMB_CH1 CMB_CH1.Text = MainV2.config["CMB_CH1"].ToString(); CMB_CH2.Text = MainV2.config["CMB_CH2"].ToString(); CMB_CH3.Text = MainV2.config["CMB_CH3"].ToString(); CMB_CH4.Text = MainV2.config["CMB_CH4"].ToString(); CMB_CH5.Text = MainV2.config["CMB_CH5"].ToString(); CMB_CH6.Text = MainV2.config["CMB_CH6"].ToString(); CMB_CH7.Text = MainV2.config["CMB_CH7"].ToString(); CMB_CH8.Text = MainV2.config["CMB_CH8"].ToString(); //revCH1 revCH1.Checked = bool.Parse(MainV2.config["revCH1"].ToString()); revCH2.Checked = bool.Parse(MainV2.config["revCH2"].ToString()); revCH3.Checked = bool.Parse(MainV2.config["revCH3"].ToString()); revCH4.Checked = bool.Parse(MainV2.config["revCH4"].ToString()); revCH5.Checked = bool.Parse(MainV2.config["revCH5"].ToString()); revCH6.Checked = bool.Parse(MainV2.config["revCH6"].ToString()); revCH7.Checked = bool.Parse(MainV2.config["revCH7"].ToString()); revCH8.Checked = bool.Parse(MainV2.config["revCH8"].ToString()); //expo_ch1 expo_ch1.Text = MainV2.config["expo_ch1"].ToString(); expo_ch2.Text = MainV2.config["expo_ch2"].ToString(); expo_ch3.Text = MainV2.config["expo_ch3"].ToString(); expo_ch4.Text = MainV2.config["expo_ch4"].ToString(); expo_ch5.Text = MainV2.config["expo_ch5"].ToString(); expo_ch6.Text = MainV2.config["expo_ch6"].ToString(); expo_ch7.Text = MainV2.config["expo_ch7"].ToString(); expo_ch8.Text = MainV2.config["expo_ch8"].ToString(); CHK_elevons.Checked = bool.Parse(MainV2.config["joy_elevons"].ToString()); } catch { } // IF 1 DOESNT EXIST NONE WILL if (MainV2.joystick != null && MainV2.joystick.enabled) { timer1.Start(); BUT_enable.Text = "Disable"; } startup = false; }