Пример #1
0
 public void FetchJoystickList()
 {
     listBoxJoysticks.Items.Clear();
     foreach (var joystick in JoystickManager.GetJoysticks())
     {
         listBoxJoysticks.Items.Add(joystick.InstanceName);
     }
     listBoxJoysticks.SelectedIndex = 0;
 }
Пример #2
0
        void ButtonStartClick(object sender, EventArgs e)
        {
            adapterManager.InitHID();

            joystickManagers = new JoystickManager[listBoxJoysticks.SelectedIndices.Count];
            for (int i = 0; i < listBoxJoysticks.SelectedIndices.Count; i++)
            {
                joystickManagers[i] = new JoystickManager();
                joystickManagers[i].SetJoystickByName(listBoxJoysticks.SelectedItems[i].ToString());
                joystickManagers[i].SetListener(this);
                joystickManagers[i].StartPolling();
            }
            buttonStart.Enabled = false;
            buttonStop.Enabled  = true;
        }
Пример #3
0
        void ButtonStartClick(object sender, EventArgs e)
        {
            adapterManager.InitHID();

            joystickManagers = new JoystickManager[listBoxJoysticks.SelectedIndices.Count];
            for(int i = 0; i < listBoxJoysticks.SelectedIndices.Count; i++) {
                joystickManagers[i] = new JoystickManager();
                joystickManagers[i].SetJoystickByName(listBoxJoysticks.SelectedItems[i].ToString());
             				joystickManagers[i].SetListener(this);
                joystickManagers[i].StartPolling();
            }
            buttonStart.Enabled = false;
            buttonStop.Enabled = true;
        }