Пример #1
0
 internal void LiftAll()
 {
     foreach (KeyValuePair <string, VirtualKeyCode> key in keys)
     {
         SendInputWrapper.Lift(key.Value, SendWithDirectX);
     }
 }
Пример #2
0
        public void PressCombo(string[] combo, int minHoldTime, int maxHoldTime, Hand hand)
        {
            List <VirtualKeyCode> vkcodes = new List <VirtualKeyCode>();

            foreach (string key in combo)
            {
                if (key != NONE && keys.Keys.Contains(key))
                {
                    vkcodes.Add(keys[key]);
                }
            }
            SendInputWrapper.PressCombo(vkcodes.ToArray(), minHoldTime, maxHoldTime, SendWithDirectX, GetRandom(hand));
        }
Пример #3
0
        private void LoadFrom(string FilePath)
        {
            string Mapping = "MappingMode";
            string Combos  = "ComboMode";
            string Mode    = Mapping;

            foreach (string raw in File.ReadAllLines(FilePath))
            {
                string field = raw.Trim().ToUpper();

                if (field.StartsWith(","))
                {
                    continue;
                }
                if (field.StartsWith(";"))
                {
                    continue;
                }
                if (field.StartsWith("//"))
                {
                    continue;
                }

                if (field.StartsWith(">"))
                {
                    if (field.Contains("MAPPING"))
                    {
                        Mode = Mapping;
                    }
                    if (field.Contains("COMBO"))
                    {
                        Mode = Combos;
                    }

                    continue;
                }


                if (Mode == Mapping)
                {
                    string[] splits = field.Split(',');
                    if (splits.Length >= 4)
                    {
                        string strVKey = splits[1].ToUpper().Trim();
                        string strHand = splits[2].ToUpper().Trim();
                        string display = splits[3].ToUpper().Trim();

                        keys.Add(display, SendInputWrapper.GetVKeyCode(strVKey));

                        switch (strHand)
                        {
                        case "LEFT":
                            setLeft(display);
                            break;

                        case "RIGHT":
                            setRight(display);
                            break;

                        default:
                            setLeft(display);
                            setRight(display);
                            break;
                        }
                    }
                }

                if (Mode == Combos)
                {
                    string[] splits = field.Split(',');
                    splits = splits.Where(x => !string.IsNullOrEmpty(x)).ToArray();
                    if (splits.Length > 0)
                    {
                        AddCombo(splits);
                    }
                }
            }

            EnableEverything();
            setAnyOtherKeyAsJolly();
            setAnyKeyAsCombo();
        }