title: Forms not responding to KeyDown events
body: <p>I've been working for a while on my Windows Forms project, and I decided to experiment with keyboard shortcuts. After a bit of reading, I figured I had to just write an event handler and bind it to the form's KeyDown event:</p>
  
  <pre><code>private void Form1_KeyDown(object sender, KeyEventArgs e)
  {
      if (e.Control &amp;&amp; e.Alt &amp;&amp; e.KeyCode == Keys.O)
      {
          MessageBox.Show("Ctrl+Alt+O: magic!");
      }
  }
  </code></pre>
  
  <p>I did that the good ol' way of opening the Properties panel of the Visual Studio designer, then double-clicking on the KeyDown event of my form to generate the <code>Form1_KeyDown</code> event handler. But on testing my application, the form doesn't respond at all to the <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>O</kbd> keyboard shortcut. The Visual Studio designer did generate the code to bind the event handler to the form though:</p>
  
  <pre><code>private void InitializeComponent()
  {
      // ...
  
      this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
  
      // ...
  }
  </code></pre>
  
  <p>So I tried adding a <code>Console.WriteLine()</code> call to the handler to check that it was being called at all, but no luck on that either.</p>
  
  <p>Also, I tried to set a breakpoint on the event binding call (shown just above) and found that the program reaches that breakpoint just fine. But any breakpoints I set within the method definition itself are never reached.</p>
  
  <p>To make sure I was doing the first few steps correctly, I tried repeating them with:</p>
  
  <ul>
  <li><p><strong>A new form in the same solution.</strong><br>
  <del>Same issue: the form doesn't respond when I press my <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>O</kbd> keyboard shortcut and the debugger isn't even stepping into the event handler.</del> Tried this again and it works.</p></li>
  <li><p><strong>A brand new WinForms solution.</strong><br>
  It works perfectly: the message dialog appears (the <code>Console.WriteLine()</code> call also works).</p></li>
  </ul>
  
  <p>So I'm quite lost here. What's preventing all the forms in this one project from receiving KeyDown events?</p>