Example #1
0
        bool SetBinding(Enum key, UniversalInputType type)
        {
            //InputNode node = InputManager.GetNode(currentKey);
            InputNode node      = draftNodes[currentKey];
            string    keyString = type.ToString() + "." + key.ToString();

            // Check for conflicts with previous bindings.
            UniversalInputCombo ic = new UniversalInputCombo(keyString);

            for (int i = 0; i < currentKey; i++)
            {
                if (draftNodes[i].Conflict(ic))
                {
                    //SoundManager.PlaySound("hit2");
                    conflictTimer = 3;
                    return(false);
                }
            }

            // Write the new binding.
            node.SetCombo(keyString);
            InputManager.UpdateAliases();

            currentKey++;
            //SoundManager.PlaySound("tap2");
            conflictTimer = 0;
            return(true);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="inData"></param>
 public void SendOneTimeData(UniversalInputType inData)
 {
     if (inData != null)
     {
         InDataQueue.Enqueue(inData);
         _background.AddOneTimeAction(OneTimeExchangeActionAsync);
     }
 }
Example #3
0
 public void FromString(string str)
 {
     string[] strItem = str.Split('.');
     if (strItem.Length != 2)
     {
         //TODO: throw exception
         return;
     }
     //TODO: catch for invalid strings in these enum conversions
     universalInputType = (UniversalInputType)Enum.Parse(typeof(UniversalInputType), strItem[0]);
     if (universalInputType == UniversalInputType.Keyboard)
     {
         keyInput = (Keys)Enum.Parse(typeof(Keys), strItem[1]);
     }
     else if (universalInputType == UniversalInputType.Mouse)
     {
         mouseInput = (MouseInput)Enum.Parse(typeof(MouseInput), strItem[1]);
     }
     else if (universalInputType == UniversalInputType.Gamepad)
     {
         gamepadInput = (GamepadInput)Enum.Parse(typeof(GamepadInput), strItem[1]);
     }
 }
 public void SendCycleTimeData(UniversalInputType inData)
 {
     throw new System.NotImplementedException();
 }
 public void SendCommand(string commandName, UniversalInputType data4Command = null)
 {
     throw new System.NotImplementedException();
 }
 public bool CheckContrains(UniversalInputType inData)
 {
     throw new NotImplementedException();
 }
 public void WriteData(UniversalInputType inData, UniversalInputType defaultInData, Func <UniversalInputType, bool> checkContrains, int?countDataTake = null)
 {
     throw new NotImplementedException();
 }
Example #8
0
 void SendCommand(string commandName, UniversalInputType data4Command = null)
 {
 }