コード例 #1
0
 private void form1_keyDown(object sender, KeyEventArgs e)
 {
     Console.WriteLine(e.KeyData);
     Console.WriteLine(e.KeyCode);
     Console.WriteLine(e.KeyValue);
     if (e.KeyValue == 32)                                                                       // 32 Space key
     {
         if (VlcPlayerBase.IsPlaying)
         {
             VlcPlayerBase.Pause();
             VlcPlayerSub.Pause();
         }
         else
         {
             VlcPlayerBase.Play();
             VlcPlayerSub.Play();
         }
     }
     if (e.KeyCode == Keys.Enter)
     {
         if (!m_bFullScreen)
         {
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.WindowState     = System.Windows.Forms.FormWindowState.Maximized;
             m_bFullScreen        = true;
         }
         else
         {
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
             this.WindowState     = System.Windows.Forms.FormWindowState.Normal;
             m_bFullScreen        = false;
         }
     }
     if (e.KeyCode == Keys.Escape)
     {
         this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
         this.WindowState     = System.Windows.Forms.FormWindowState.Normal;
         m_bFullScreen        = false;
     }
 }