public KeystrokesDisplay(IKeystrokeEventProvider k, SettingsStore s) { InitializeComponent(); this.k = k; this.k.KeystrokeEvent += k_KeystrokeEvent; this.settings = s; this.settings.settingChanged += settingChanged; this.settings.OnSettingChangedAll(); this.TopMost = true; this.FormClosing += Form1_FormClosing; addWelcomeInfo(); NativeMethodsSWP.SetWindowTopMost(this.Handle); ActivateDisplayOnlyMode(true); if (settings.EnableWindowFade) { Opacity = 0; FadeStatus = FadeStatuses.Hidden; } else { Opacity = 1; FadeStatus = FadeStatuses.Visible; } settings.settingChanged += (SettingsChangedEventArgs e) => { if (settings.EnableWindowFade && tweenLabels.Count == 0 && Opacity > 0) { FadeOut(); } else { Opacity = 1; FadeStatus = FadeStatuses.Visible; } }; }
public KeystrokesDisplay(IKeystrokeEventProvider k, SettingsStore s) { InitializeComponent(); this.k = k; this.k.KeystrokeEvent += k_KeystrokeEvent; this.settings = s; this.settings.settingChanged += settingChanged; this.settings.OnSettingChangedAll(); this.TopMost = true; this.FormClosing += Form1_FormClosing; addWelcomeInfo(); NativeMethodsSWP.SetWindowTopMost(this.Handle); ActivateDisplayOnlyMode(true); }
private void InitKeyboardInterception() { myKeyboardHook = new KeyboardHook(); myKeystrokeConverter = new KeystrokeParser(myKeyboardHook); }