Exemplo n.º 1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (!PollingInput && Joystick != null && Allowed)
     {
         PollingInput = true;
         Result       = JoystickReader.GetJoystickInput(Joystick);
         if (Result != null)
         {
             EndChecks(Result);
         }
         PollingInput = false;
     }
 }
Exemplo n.º 2
0
        public bool ShowInputDialog()
        {
            JoystickInputSelectorDialog dlg = new JoystickInputSelectorDialog();

            if (dlg.ShowDialog() == true)
            {
                Joystick = JoystickReader.GetJoystick();
                timer1.Start();
                return(this.ShowDialog().Value);
            }
            else
            {
                return(false);
            }
        }
        private void RefreshInputsList()
        {
            listBox1.IsEnabled = true;
            NoDevicesFound     = false;

            listBox1.ItemsSource = null;
            listBox1.Items.Clear();
            listBox1.ItemsSource = JoystickReader.GetJoysticks();
            if (JoystickReader.GetJoystickCount() == 0)
            {
                NoDevicesFound = true;
                string no_item_found = Program.LanguageResource.GetString("NoControllerFound");
                if (no_item_found == null)
                {
                    no_item_found = "";
                }
                listBox1.IsEnabled   = false;
                listBox1.ItemsSource = null;
                listBox1.Items.Add(no_item_found);
                selectButton.IsEnabled = false;
                listBox1.SelectedIndex = -1;
            }
        }