private void OpenForm(Key key, PoseCombination poseCombination)
 {
     if (poseCombination.IsKeyExist(key))
     {
         poseCombination.ToggleKey(key);
     }
     else
     {
         KeyState keyState = new KeyState();
         DialogResult result = keyState.ShowDialog();
         if (result == System.Windows.Forms.DialogResult.OK)
         {
             key.State = keyState.GetKeyState();
             poseCombination.ToggleKey(key);
         }
     }
 }
 public void AddKey(Key key)
 {
     _keys.Add(key);
 }
 public void RemoveKey(Key key)
 {
     for (int i = 0; i < _keys.Count; i++)
     {
         if (_keys[i].Code == key.Code)
             _keys.RemoveAt(i);
     }
 }
 /**
  * 加入按鍵
  */
 public void ToggleKey(Key key)
 {
     if (IsKeyExist(key))
     {
         RemoveKey(key);
     }
     else
     {
         AddKey(key);
     }
 }
 public bool IsKeyExist(Key key)
 {
     return _keys.Exists(item => item.Code == key.Code);
 }