private MeasureWnd createWindowForScreen(System.Windows.Forms.Screen screen) { var ret = new MeasureWnd(screen); _MeasureWnds.Add(screen.DeviceName, ret); System.Diagnostics.Debug.WriteLine($"Created window for screen {screen.DeviceName}"); return(ret); }
private void _KListener_KeyDown(object sender, KB_Hook.RawKeyEventArgs args) { try { var key = args.Key; var mods = checkModifiers(); if (Config.AppSettings.ToggleMeasureWindowShortCut.IsPressed(args.Key, mods)) { _toggledWindow = _toggledWindow ?? showMeasureWnd(); } else if (Config.AppSettings.ShowHideMeasureWindowShortCut.IsPressed(args.Key, mods)) { if (isMeasureWndVisible()) { hideMeasureWnd(); } else { showMeasureWnd(); } } } catch (Exception e) { handleException(e); } }
private void hideToggledWindow() { _toggledWindow?.Hide(); _toggledWindow = null; }