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()); } }
public void Clear() { Logger.LogAction((LogFunction log) => { log("Clearing {0} '{1}', {2}", GetType().Name, IdOrName, Description); }); TypeTextAction.Clear(); }
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); }
public void Clear() { Logger.LogAction("Clearing " + GetType().Name + " '" + ToString() + "'"); TypeTextAction.Clear(); }
public void AppendText(string value) { Logger.LogAction("Appending '" + value + "' to " + GetType().Name + " '" + ToString() + "'"); TypeTextAction.AppendText(value); }
public void TypeText(string value) { Logger.LogAction("Typing '" + value + "' into " + GetType().Name + " '" + ToString() + "'"); TypeTextAction.TypeText(value); }