Пример #1
0
        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;
            }
        }
Пример #2
0
 /// <summary>
 /// INCEASE VOLUMNE
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonDecreaseVolume_Click(object sender, EventArgs e)
 {
     SpotifyProvider.PerformDecreaseVolume();
 }