Exemplo n.º 1
0
        // enable hotkey feature
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            Keys k = Keys.I | Keys.Control | Keys.Alt;  // hotkey

            WindowsShell.RegisterHotKey(this, k);
        }
Exemplo n.º 2
0
        // unregister hotkey feature
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            WindowsShell.UnregisterHotKey(this);

            notifyIcon1.Visible = false;
            notifyIcon1.Dispose();
        }
Exemplo n.º 3
0
        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Right:
                if (e.Control)
                {
                    iTunes.PlayerPosition += 30;
                    FlashLabel(this.lblFwd30s);
                }
                else
                {
                    iTunes.PlayerPosition += 5;
                    FlashLabel(this.lblFwd5s);
                }
                break;

            case Keys.Left:
                if (e.Control)
                {
                    iTunes.PlayerPosition -= 30;
                    FlashLabel(this.lblRwd30s);
                }
                else
                {
                    iTunes.PlayerPosition -= 5;
                    FlashLabel(this.lblRwd5s);
                }
                break;

            case Keys.Up:
                if (e.Control)
                {
                    iTunes.SoundVolume = iTunes.SoundVolume + 4;
                    FlashLabel(this.lblVolUp);
                }
                else
                {
                    iTunes.PreviousTrack();
                    FlashLabel(this.lblPrevTrk);
                }
                break;

            case Keys.Down:
                if (e.Control)
                {
                    iTunes.SoundVolume = iTunes.SoundVolume - 4;
                    FlashLabel(this.lblVolDown);
                }
                else
                {
                    iTunes.NextTrack();
                    FlashLabel(this.lblNextTrk);
                }
                break;

            case Keys.Space:
                iTunes.PlayPause();
                FlashLabel(this.lblPlayPause);
                break;

            case Keys.I:
                WindowsShell.ActivateWindow("iTunes");
                SwitchActiveState();
                FlashLabel(this.lblActivateItunes);
                break;

            case Keys.U:
                iTunes.UpdatePodcastFeeds();
                FlashLabel(this.lblUpdatePodcasts);
                break;

            case Keys.S:
                FlashLabel(this.lblSyncIPods);
                SyncAlliPods();
                break;
            }
        }