Example #1
0
        public Controller()
        {
            InitializeComponent();
            //typer = new KeyBDEventTyper();
            typer = new SendInputTyper();

            this.Icon = Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetEntryAssembly().Location);
        }
Example #2
0
 public ControlItem(string input, Typer typer)
 {
     string[] args = input.Split(' ');
     this.function = args[0];
     this.arguments = new List<string>();
     for (int i = 1; i < args.Length; ++i)
         if (!string.IsNullOrEmpty(args[i]))
             this.arguments.Add(args[i]);
     this.typer = typer;
 }
Example #3
0
        public static List<TypeItem> parse(string input, Typer typer)
        {
            List<TypeItem> output = new List<TypeItem>();
            StringBuilder buffer = new StringBuilder();
            int index = 0;

            while (index < input.Length) {
                char ch = input[index];
                switch (ch) {
                    case '\\':
                        System.Diagnostics.Debug.Write("Saw escaped: " + input[index + 1]);
                        buffer.Append(input[++index]);
                        break;
                    case '<':
                        if (buffer.Length > 0) {
                            output.Add(new StringItem(buffer.ToString(), typer));
                            //buffer.clear();
                            buffer = new StringBuilder();
                        }
                        while (input[++index] != '>')
                            buffer.Append(input[index]);
                        string buf = buffer.ToString();
                        System.Diagnostics.Debug.Write("Saw Combo: " + buf);
                        if (buf.Contains(" ") || buf == "guid") {
                            output.Add(new ControlItem(buf, typer));
                        } else {
                            output.Add(new KeyComboItem(buf, typer));
                        }
                        buffer = new StringBuilder();
                        //buffer.clear();
                        break;
                    default:
                        System.Diagnostics.Debug.Write("Saw Text: " + input[index]);
                        buffer.Append(input[index]);
                        break;
                }
                ++index;
            }
            if (buffer.Length > 0)
                output.Add(new StringItem(buffer.ToString(), typer));
            return output;
        }
Example #4
0
 public KeyComboItem(string input, Typer typer)
 {
     this.keys = ParseKeyCombo(input);
     this.typer = typer;
 }
Example #5
0
 public StringItem(string input, Typer typer)
 {
     this.text = input;
     this.typer = typer;
 }