private void RegisterHotKey() { hotkeyHelper = new HotkeyHelper(this.deskStock.Handle); showWindowKey = hotkeyHelper.RegisterHotkey(Keys.Oemtilde, HotkeyHelper.KeyFlags.MOD_CONTROL); stopOrStartServicekey = hotkeyHelper.RegisterHotkey(Keys.Oemtilde, HotkeyHelper.KeyFlags.MOD_WIN); showWarnKey = hotkeyHelper.RegisterHotkey(Keys.D1, HotkeyHelper.KeyFlags.MOD_CONTROL); hotkeyHelper.OnHotkey += new HotkeyEventHandler(OnHotkey); }
private void Mini_Shown(object sender, EventArgs e) { hotkeyHelper = new HotkeyHelper(Handle); playKey = hotkeyHelper.RegisterHotkey(Keys.F5, KeyModifiers.Alt); playKey1 = hotkeyHelper.RegisterHotkey(Keys.Play, KeyModifiers.None); playKey2 = hotkeyHelper.RegisterHotkey(Keys.Pause, KeyModifiers.None); nextKey = hotkeyHelper.RegisterHotkey(Keys.Right, KeyModifiers.Alt); nextKey1 = hotkeyHelper.RegisterHotkey(Keys.MediaNextTrack, KeyModifiers.None); hotkeyHelper.OnHotkey += OnHotkey; }
private void RegisterHotKey() { HotkeyHelper helper = new HotkeyHelper(base.Handle); this.Hotkey1 = helper.RegisterHotkey(Keys.F2, HotkeyHelper.KeyFlags.MOD_CONTROL); helper.OnHotkey += new HotkeyEventHandler(this.hotkey_OnHotkey); }
private void Main_Mini_Switcher_Click(object sender, EventArgs e) { Visible = false; UpdateTimer.Enabled = false; _hotkeyHelper.UnregisterHotkeys(); NotifySystem.RegisterClick(null); using (var dialog = new Mini()) { dialog.ShowDialog(); } NotifySystem.RegisterClick(TaskbarIconClickHandler); _playKey = _hotkeyHelper.RegisterHotkey(Keys.F5, KeyModifiers.Alt); _prevKey = _hotkeyHelper.RegisterHotkey(Keys.Left, KeyModifiers.Alt); _nextKey = _hotkeyHelper.RegisterHotkey(Keys.Right, KeyModifiers.Alt); _hotkeyHelper.OnHotkey += OnHotkey; Main_PlayList.SelectedIndices.Clear(); int currentset = Core.CurrentSetIndex; if (currentset == -1) { currentset = 0; } Main_PlayList.SelectedIndices.Add(currentset); Main_PlayList.EnsureVisible(currentset); Main_PlayList.Focus(); Core.SetBG(); if (Core.Isplaying) { Main_Time_Trackbar.MaxValue = (int)Core.Durnation * 1000; Main_Time_Trackbar.Enabled = true; UpdateTimer.Enabled = true; Main_Play.Text = LanguageManager.Get("Main_Pause_Text"); Main_Stop.Enabled = true; } else { Main_Time_Trackbar.Enabled = false; UpdateTimer.Enabled = false; Main_Play.Text = LanguageManager.Get("Main_Play_Text"); Main_Stop.Enabled = false; } Visible = true; }
private void Main_Shown(object sender, EventArgs e) { CenterToScreen(); Core.Init(Main_Main_Display.Handle, Main_Main_Display.Size); SetForm(); RefreshList(); VisibleChanged += Main_VisibleChanged; SizeChanged += Main_SizeChanged; NotifySystem.RegisterClick(TaskbarIconClickHandler); Core.MainIsVisible = true; _hotkeyHelper = new HotkeyHelper(Handle); _playKey = _hotkeyHelper.RegisterHotkey(Keys.F5, KeyModifiers.Alt); _playKey1 = _hotkeyHelper.RegisterHotkey(Keys.Play, KeyModifiers.None); _playKey2 = _hotkeyHelper.RegisterHotkey(Keys.Pause, KeyModifiers.None); _prevKey = _hotkeyHelper.RegisterHotkey(Keys.Left, KeyModifiers.Alt); _prevKey1 = _hotkeyHelper.RegisterHotkey(Keys.MediaPreviousTrack, KeyModifiers.None); _nextKey = _hotkeyHelper.RegisterHotkey(Keys.Right, KeyModifiers.Alt); _nextKey1 = _hotkeyHelper.RegisterHotkey(Keys.MediaNextTrack, KeyModifiers.None); _hotkeyHelper.OnHotkey += OnHotkey; Main_Main_Display.ResumeLayout(); }