private void MainWindows_Keydown(object sender, KeyEventArgs e) { //老板键(缩小所有播放窗口) if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.D) { BossKey?.Invoke(this, EventArgs.Empty); } //音量增加 if (e.KeyStates == Keyboard.GetKeyStates(Key.Up)) { if (音量.Value + 5 <= 100) { 音量.Value += 5; Play_SETVolume((int)音量.Value); //this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } else { 音量.Value = 100; Play_SETVolume((int)音量.Value); //this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } } //音量降低 else if (e.KeyStates == Keyboard.GetKeyStates(Key.Down)) { if (音量.Value - 5 >= 0) { 音量.Value -= 5; Play_SETVolume((int)音量.Value); // this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } else { 音量.Value = 0; Play_SETVolume((int)音量.Value); // this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } } //全屏回车 else if (e.KeyStates == Keyboard.GetKeyStates(Key.Enter)) { 设置全屏(); } //F5刷新 else if (e.KeyStates == Keyboard.GetKeyStates(Key.F5)) { new Task(() => { Play_STOP(); //this.VlcControl.SourceProvider.MediaPlayer.Stop();//这里要开线程处理,不然会阻塞播放 刷新播放("检测到F5按下,刷新中..", true); }).Start(); } 首页焦点.Focus(); }
private void MainWindows_Keydown(object sender, KeyEventArgs e) { if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.D) { BossKey?.Invoke(this, EventArgs.Empty); } //音量增加 if (e.KeyStates == Keyboard.GetKeyStates(Key.Up)) { if (音量.Value + 5 <= 100) { 音量.Value += 5; this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } else { 音量.Value = 100; this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } } //音量降低 else if (e.KeyStates == Keyboard.GetKeyStates(Key.Down)) { if (音量.Value - 5 >= 0) { 音量.Value -= 5; this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } else { 音量.Value = 0; this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } } //全屏回车 else if (e.KeyStates == Keyboard.GetKeyStates(Key.Enter)) { if (this.WindowState == WindowState.Normal) { this.WindowState = WindowState.Maximized; } else if (this.WindowState == WindowState.Maximized) { this.WindowState = WindowState.Normal; } } //F5刷新 else if (e.KeyStates == Keyboard.GetKeyStates(Key.F5)) { new Task(() => { this.VlcControl.SourceProvider.MediaPlayer.Stop();//这里要开线程处理,不然会阻塞播放 刷新播放("检测到F5按下,刷新中.."); }).Start(); } }
private void MainWindows_Keydown(object sender, KeyEventArgs e) { //老板键(缩小所有播放窗口) if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.D) { BossKey?.Invoke(this, EventArgs.Empty); } //音量增加 if (e.KeyStates == Keyboard.GetKeyStates(Key.Up)) { if (音量.Value + 5 <= 100) { 音量.Value += 5; Play_SETVolume((int)音量.Value); //this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } else { 音量.Value = 100; Play_SETVolume((int)音量.Value); //this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } } //音量降低 else if (e.KeyStates == Keyboard.GetKeyStates(Key.Down)) { if (音量.Value - 5 >= 0) { 音量.Value -= 5; Play_SETVolume((int)音量.Value); // this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } else { 音量.Value = 0; Play_SETVolume((int)音量.Value); // this.VlcControl.SourceProvider.MediaPlayer.Audio.Volume = (int)音量.Value; } } //全屏回车 else if (e.KeyStates == Keyboard.GetKeyStates(Key.Enter)) { if (this.WindowState == WindowState.Normal) { this.WindowState = WindowState.Maximized; } else if (this.WindowState == WindowState.Maximized) { this.WindowState = WindowState.Normal; } if (字幕.字幕位置 != (int)this.Width / 100 * (int)字幕位置.Value) { 字幕.字幕位置 = (int)this.Width / 100 * (int)字幕位置.Value; if (字幕.FontSize > 50) { 字幕.FontSize = 1; } else { 字幕.FontSize++; } } } //F5刷新 else if (e.KeyStates == Keyboard.GetKeyStates(Key.F5)) { new Task(() => { Play_STOP(); //this.VlcControl.SourceProvider.MediaPlayer.Stop();//这里要开线程处理,不然会阻塞播放 刷新播放("检测到F5按下,刷新中..", true); }).Start(); } }