예제 #1
0
 /// <summary>
 /// Begins a new input. If there is no primary input the new
 /// input will become the primary. If there is no secondary,
 /// then the new input will become the secondary. If both
 /// primary and secondary are active, nothing happens.
 /// </summary>
 /// <param name="input">New input to begin</param>
 public void BeginInput(NaturalInput input)
 {
     if (_primaryInput == null)
     {
         _primaryInput = input;
         if (onBeginPrimary != null)
         {
             onBeginPrimary();
         }
     }
     else if (_secondaryInput == null)
     {
         _secondaryInput = input;
         if (onBeginSecondary != null)
         {
             onBeginSecondary();
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Ends an active input. If the input is the primary
 /// input, then both primary and secondary are ended.
 /// If it is the secondary input, just the secondary is
 /// ended. If the input is neither the primary or secondary
 /// nothing happens.
 /// </summary>
 /// <param name="input"></param>
 public void EndInput(NaturalInput input)
 {
     if (_primaryInput == input)
     {
         _primaryInput   = null;
         _secondaryInput = null;
         if (onEndSecondary != null)
         {
             onEndSecondary();
         }
         if (onEndPrimary != null)
         {
             onEndPrimary();
         }
     }
     else if (_secondaryInput == input)
     {
         _secondaryInput = null;
         if (onEndSecondary != null)
         {
             onEndSecondary();
         }
     }
 }