Пример #1
0
 public async static Task Send(SequenceItem[] items)
 {
     ExecuteSequenceItems(items);
 }
Пример #2
0
 public async static Task Send(SequenceItem item)
 {
     ExecuteSequenceItem(item);
 }
Пример #3
0
 public static void ExecuteSequenceItems(SequenceItem[] items)
 {
     foreach (var sequenceItem in items)
     {
         ExecuteSequenceItem(sequenceItem);
     }
 }
Пример #4
0
 public static void ExecuteSequenceItem(SequenceItem item)
 {
     var keys = new List<Keys>();
     keys.AddRange(item.Modifiers.Select(m => (Keys)m.Value));
     keys.Add((Keys)item.Entry.Value);
     ExecuteKeyboardCommand(keys, item.KeepDown);
     //if (item.Method.Equals("sendinput"))
     //    ExecuteKeyboardCommand(keys, item.KeepDown);
     //else
     //    ExecuteVirtualKeyboardCommand(keys, item.KeepDown);
     Thread.Sleep(item.KeepDown);
 }
Пример #5
0
 private async void SendInputMod(string input, string[] modifiers, int keepDown, Func<JsValue, JsValue[], JsValue> callBackFunction)
 {
     try
     {
         if (!testMode)
         {
             var sequence = new SequenceItem(keepDown, new SequenceKeyValuePair(input, GetKeyValue(input)));
             foreach (var mod in modifiers)
             {
                 sequence.Modifiers.Add(new SequenceKeyValuePair(mod, GetKeyValue(mod)));
             }
             await Sender.Send(sequence);
         }
         callBackFunction(JsValue.Undefined, new[] { JsValue.Undefined });
     }
     catch (Exception e)
     {
         ObjectFactory.GetProvider<ILoggingProvider>().Error(e.Message, e);
     }
 }
Пример #6
0
 private void SendInputModSync(string input, string[] modifiers, int keepDown)
 {
     try
     {
         if (!testMode)
         {
             var sequence = new SequenceItem(keepDown, new SequenceKeyValuePair(input, GetKeyValue(input)));
             foreach (var mod in modifiers)
             {
                 sequence.Modifiers.Add(new SequenceKeyValuePair(mod, GetKeyValue(mod)));
             }
             Sender.Send(sequence).Wait(keepDown);
         }
     }
     catch (Exception e)
     {
         ObjectFactory.GetProvider<ILoggingProvider>().Error(e.Message, e);
     }
 }