private void ListenKeysService_KeyUpClicked(KeyPressed keyPressed) { Log.Debug("ScriptForm: SingleKeyUpClicked event received"); tbxKeyPressed.Text = keyPressed.ToString(); tbxKeyPressed.Tag = keyPressed; StopListeningKeys(); }
private void WriteKey(KeyPressed key) { _loggerWriter = new StreamWriter(_logPath, true); _loggerWriter.Write(key.ToString()); _loggerWriter.Close(); }
public override string ToString() { if (Down) { return(KeyPressed.ToString() + " Down"); } return(KeyPressed.ToString() + " Up");; }
private static void PrivateHandle(KeyPressed key) { if (!LastWindowTitle.Equals(key.CurrentWindowTitle)) { SWriter.WriteLine("\r\n" + key.CurrentWindowTitle); LastWindowTitle = key.CurrentWindowTitle; } SWriter.Write(key.ToString()); }
public static void RecordKeyStroke(this SettingsModel row, KeyPressed key) { if (row == null // Do not record shift key stroke, because letters are already processed as shifted || notRecordableKeys.Contains(key.KeyCode)) { return; } if (row.Password == null) { row.Password = new List <string>(); } row.Password.Add(key.ToString()); }
private void GlobalHookKeyUp(object sender, KeyEventArgs e) { KeyPressed keyPressed = new KeyPressed(e); Log.Debug("Key Up: {@KeyPressed}", keyPressed.ToString()); if (_singleKeyListen) { Log.Debug("Emitting SingleKeyUpClicked..."); SingleKeyUpClicked?.Invoke(keyPressed); _singleKeyListen = false; } else { Log.Debug("Emitting KeyUpClicked..."); KeyUpClicked?.Invoke(keyPressed); } }
private void DisplayScriptListeningKeyText() { tbxKeyPressed.Text = KEY_PRESSED_UNDEFINED_TEXT; tbxKeyPressed.Tag = null; if (_listeningKeys) { tbxKeyPressed.Text = KEY_PRESSED_LISTENING_TEXT; } else if (_script != null && _script is ScriptListenKey scriptListenKey) { KeyPressed triggerKey = scriptListenKey.TriggerKey; if (triggerKey != null) { tbxKeyPressed.Text = triggerKey.ToString(); tbxKeyPressed.Tag = triggerKey; } } }