private void EventBinding() { MainWin.StateChanged += MainWindowState; MainWin.KeyCombSelect.GotFocus += KeyCombSelect_GotFocus; MainWin.KeyCombSelect.LostFocus += KeyCombSelect_LostFocus; MainWin.ChangeLogWay.Click += ChangeLogWay_Click; switch (Properties.Settings.Default.TranslationWay) { case "Clipboard": KeyHook = new KeyboardHooking(new NotificatorClipboardText()); break; case "Screen": KeyHook = new KeyboardHooking(new NotificatorScreenText()); break; } KeyHook.Start(SettingsManager.KeyFromString(Properties.Settings.Default.KeyComb)); }
private void ThisAddIn_Shutdown(object sender, System.EventArgs e) { //disable keyboard intercepts KeyboardHooking.ReleaseHook(); }
private void ThisAddIn_Startup(object sender, System.EventArgs e) { //enable keyboard intercepts KeyboardHooking.SetHook(); }