title: How do I run some simple C# code for a given keypress?
body: <p>I have a button on a XAML form that calls the <code>btnName_Click()</code> code in the backing <code>cs</code> file.</p>
  
  <p>I also want to assign a keyboard shortcut to run that same code. Basically <kbd>CTRL</kbd> + <kbd>&larr;</kbd> or something similar.</p>
  
  <p>This needs to work regardless of the control I'm currently in (there's a TextBox for example that I want to ensure doesn't capture the event if I'm in there).</p>
  
  <p>I've read up on routed commands but that seems like a lot of work for something which should be simple.</p>
  
  <p>Is there an easy way to do this or do I need to create routed commands? If I do need to use them, what's the simplest way to achieve what I want?</p>