示例#1
0
        public void Set_Joystick_Settings(object sender, EventArgs e)
        {
            int i;

            string[] sticks;


            // grab the joystick
            jyst   = new JoystickMngr(this.Handle);
            sticks = jyst.FindJoysticks();
            joystickComboBox.Items.Clear();

            if (sticks == null)
            {
                IsJoyFound_label.Text = "No Joystick";
                return;
            }

            for (i = 0; i < sticks.Length; i++)
            {
                joystickComboBox.Items.Add(sticks[i]);
            }
            try
            {
                joystickComboBox.SelectedIndex = 0;
            }
            catch
            {
                joystickComboBox.Items.Clear();
                joystickComboBox.Items.Add("None");
                joystickComboBox.SelectedIndex = 0;
                IsJoyFound_label.Text          = "No Joystick";
                debug.Append("Failed assigning Joystick\r\n");
            }

            Get_Joystick(null, null);
        }
示例#2
0
        public void Set_Joystick_Settings(object sender, EventArgs e)
        {
            int i;
            string[] sticks;

            // grab the joystick
            jyst = new JoystickMngr(this.Handle);
            sticks = jyst.FindJoysticks();
            joystickComboBox.Items.Clear();

            if (sticks == null)
            {
               IsJoyFound_label.Text = "No Joystick";
                return;
            }

            for (i = 0; i < sticks.Length; i++)
            {
                joystickComboBox.Items.Add(sticks[i]);
            }
            try
            {
                joystickComboBox.SelectedIndex = 0;
            }
            catch
            {
                joystickComboBox.Items.Clear();
                joystickComboBox.Items.Add("None");
                joystickComboBox.SelectedIndex = 0;
                IsJoyFound_label.Text = "No Joystick";
                debug.Append("Failed assigning Joystick\r\n");
            }

            Get_Joystick(null, null);
        }