示例#1
0
 void HookManager_KeyPress(object sender, KeyPressExEventArgs e)
 {
     try
     {
         UpdateWorkingDir(true);
         lock (_locker)
         {
             if (_is_monitoring)
             {
                 UserAction action;
                 if (e.KeyChar != char.MinValue && e.KeyChar != '\r' && e.KeyChar != '\b' && e.KeyCode != Keys.Escape &&
                     ((_modifiers == ContextLib.DataContainers.Monitoring.UserAction.Modifiers.None) ||
                      (_modifiers == ContextLib.DataContainers.Monitoring.UserAction.Modifiers.Shift) ||
                      (_modifiers == ContextLib.DataContainers.Monitoring.UserAction.Modifiers.CapsLock) ||
                      (_modifiers == (ContextLib.DataContainers.Monitoring.UserAction.Modifiers.Shift | ContextLib.DataContainers.Monitoring.UserAction.Modifiers.CapsLock)) ||
                      (_modifiers == (ContextLib.DataContainers.Monitoring.UserAction.Modifiers.Alt | ContextLib.DataContainers.Monitoring.UserAction.Modifiers.Ctrl))))
                 {
                     action = new TypeTextAction(new string(e.KeyChar, 1));
                 }
                 else
                 {
                     action = new KeyPressAction(e.KeyCode, _modifiers);
                     ((KeyPressAction)action).KeyChar = e.KeyChar;
                 }
                 if (_is_recording)
                 {
                     _macro.AddAction(action);
                 }
                 if (!IsBrowsingExplorerWindow(action.Window))
                 {
                     _actions.AddAction(action);
                 }
                 else
                 {
                     _actions.ValidadeActions();
                 }
                 NotifyOtherAgents();
                 _last_user_action = DateTime.Now;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
示例#2
0
        public void Clear()
        {
            Logger.LogAction((LogFunction log) => { log("Clearing {0} '{1}', {2}", GetType().Name, IdOrName, Description); });

            TypeTextAction.Clear();
        }
示例#3
0
        public void AppendText(string value)
        {
            Logger.LogAction((LogFunction log) => { log("Appending '{0}' to {1} '{2}', {3}", value, GetType().Name, IdOrName, Description); });

            TypeTextAction.AppendText(value);
        }
        public void TypeText(string value)
        {
            Logger.LogAction("Typing '{0}' into {1} '{2}', {3}", value, GetType().Name, IdOrName, Description);

            TypeTextAction.TypeText(value);
        }
示例#5
0
文件: TextField.cs 项目: minskowl/MY
        public void Clear()
        {
            Logger.LogAction("Clearing " + GetType().Name + " '" + ToString() + "'");

            TypeTextAction.Clear();
        }
示例#6
0
文件: TextField.cs 项目: minskowl/MY
        public void AppendText(string value)
        {
            Logger.LogAction("Appending '" + value + "' to " + GetType().Name + " '" + ToString() + "'");

            TypeTextAction.AppendText(value);
        }
示例#7
0
文件: TextField.cs 项目: minskowl/MY
        public void TypeText(string value)
        {
            Logger.LogAction("Typing '" + value + "' into " + GetType().Name + " '" + ToString() + "'");

            TypeTextAction.TypeText(value);
        }