async void hook_KeyDown(object sender, KeyEventArgs e) { if (ControlButtonPressed) { ControlButtonPressed = false; e.Handled = true; switch (e.KeyCode) { case Keys.Space: ControlButtonPressed = false; Console.WriteLine("PauseStopp Performed"); this.textBoxCurrentSongName.Text = await SpotifyProvider.PerformPlayAsync(); e.Handled = true; return; case Keys.End: e.Handled = true; return; case Keys.Up: SpotifyProvider.PerformIncreaseVolume(); e.Handled = true; return; case Keys.Down: SpotifyProvider.PerformDecreaseVolume(); e.Handled = true; return; case Keys.Right: this.textBoxCurrentSongName.Text = await SpotifyProvider.PerformNextSongAsync(); e.Handled = true; return; case Keys.Left: this.textBoxCurrentSongName.Text = await SpotifyProvider.PerformPreviousSongAsync(); e.Handled = true; return; case Keys.LControlKey: e.Handled = true; return; case Keys.LShiftKey: e.Handled = true; return; default: e.Handled = true; return; } } if (Keys.LShiftKey == e.KeyCode) { ControlButtonPressed = true; e.Handled = true; } }
/// <summary> /// LAST SONG /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void button3_Click(object sender, EventArgs e) { this.textBoxCurrentSongName.Text = await SpotifyProvider.PerformPreviousSongAsync(); }