/// <summary> /// Looks for key combinations to launch the timer form (to set a timer quickly) /// </summary> /// <param name="sender"></param> /// <param name="e">The keyeventargs which contains the pressed keys</param> private void GlobalKeyPress(object sender, KeyEventArgs e) { if (BLSettings.GetSettings().EnableQuickTimer != 1) //Not enabled? don't do anything { return; } if (!e.Shift && !e.Control && !e.Alt) //None of the key key's (get it?) pressed? return. { return; } //Good! now let's check if the KeyCode is not alt shift or ctr if (e.KeyCode == Keys.Alt || e.KeyCode == Keys.ControlKey || e.KeyCode == Keys.ShiftKey) { return; } timerHotkey = BLHotkeys.TimerPopup; if (e.Modifiers.ToString().Replace(" ", string.Empty) == timerHotkey.Modifiers && e.KeyCode.ToString() == timerHotkey.Key) { BLIO.Log("Timer hotkey combination pressed!"); TimerPopup quickTimer = new TimerPopup(); quickTimer.Show(); } }
private void btnNewTimer_Click(object sender, EventArgs e) { BLIO.Log("btnNewTimer clicked!"); TimerPopup quickTimer = new TimerPopup(); quickTimer.Show(); }
public TimerPopup() { InitializeComponent(); instance = this; this.Opacity = 0; tmrFadeIn.Start(); tbTime.KeyUp += TimerPopup_KeyUp; tbNote.KeyUp += TimerPopup_KeyUp; this.KeyUp += TimerPopup_KeyUp; BLIO.Log("TimerPopup created"); }
/// <summary> /// Looks for key combinations to launch the timer form (to set a timer quickly) /// </summary> /// <param name="sender"></param> /// <param name="e">The keyeventargs which contains the pressed keys</param> private void GlobalKeyPressDown(object sender, KeyEventArgs e) { if (!e.Shift && !e.Control && !e.Alt) //None of the key key's (get it?) pressed? return. { return; } if (BLLocalDatabase.Setting.Settings.EnableQuickTimer != 1) //Not enabled? don't do anything { return; } //Good! now let's check if the KeyCode is not alt shift or ctrl if (e.KeyCode == Keys.Alt || e.KeyCode == Keys.ControlKey || e.KeyCode == Keys.ShiftKey) { return; } timerHotkey = BLLocalDatabase.Hotkey.TimerPopup; timerCheckHotKey = BLLocalDatabase.Hotkey.TimerCheck; if (TimerPopup.Instance == null && e.Modifiers.ToString().Replace(" ", string.Empty) == timerHotkey.Modifiers && e.KeyCode.ToString() == timerHotkey.Key) { //Don't allow other applications to also fire this key combination, ctrl+shift+r would for example reload the page at the same time e.Handled = true; BLIO.Log("Timer hotkey combination pressed!"); TimerPopup quickTimer = new TimerPopup(); quickTimer.Show(); } if (TimerCheck.Instance == null && UCTimer.RunningTimers.Count > 0 && e.Modifiers.ToString().Replace(" ", string.Empty) == timerCheckHotKey.Modifiers && e.KeyCode.ToString() == timerCheckHotKey.Key) { //Don't allow other applications to also fire this key combination, ctrl+shift+r would for example reload the page at the same time e.Handled = true; BLIO.Log("Timer check hotkey combination pressed!"); TimerCheck check = new TimerCheck(); check.Show(); } }
private void TimerPopup_FormClosed(object sender, FormClosedEventArgs e) { instance = null; }