Exemplo n.º 1
0
        public void cmbType_SelectedIndexChanged(object sender, EventArgs e)
        {
            // need to fill the switches list
            cmbSwitch.Items.Clear();
            m_DisplayedParams.Clear();
            switch (Type)
            {
            case PhysicalSwitch.Types.Joystick:
                AddParam(0);
                AddParam(1);
                cmbSwitch.Enabled = true;
                break;

            case PhysicalSwitch.Types.Keyboard:
                AddParam((int)Keys.Enter);
                AddParam((int)Keys.Space);
                AddParam((int)Keys.Tab);
                AddParam((int)Keys.Escape);
                cmbSwitch.Enabled = true;
                break;

            default:
                cmbSwitch.Enabled = false;                         // mainly for when this is first created
                break;
            }
            if (!m_Filling)
            {
                // if user has changed we will need to reassign the param
                Parameter = m_DisplayedParams[0];
                UserChangedSwitch?.Invoke(this, EventArgs.Empty);
            }
        }
Exemplo n.º 2
0
 public void cmbSwitch_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!m_Filling)
     {
         UserChangedSwitch?.Invoke(this, EventArgs.Empty);
     }
 }
Exemplo n.º 3
0
 private void SwitchDetected(PhysicalSwitch.Types type, int param)
 {
     StopDetection();
     Type = type;
     if (m_DisplayedParams.IndexOf(param) < 0)
     {
         AddParam(param);
     }
     Parameter = param;
     UserChangedSwitch?.Invoke(this, EventArgs.Empty);
     lblAutoDetect.Visible = false;
 }