title: C# WPF Capture Keyboard and Mouse
body: <p>So I have a WPF Window that captures mouse events on an image.  I am doing this by the following code:</p>
  
  <pre><code>&lt;Image Name="imgPrimaryImage" Width="512" Height="512" RenderOptions.BitmapScalingMode="NearestNeighbor" Margin="5"
         Source="{Binding Path=ImageMgr.ImageSource}"
                   MouseLeftButtonDown="OnMouseLeftButtonDown" 
                   MouseMove="OnMouseMove"
                   MouseLeftButtonUp="OnMouseLeftButtonUp"/&gt;
  </code></pre>
  
  <p><strong>Application Functionality:</strong> While the user moves the mouse left and right it changes the size of the image so long as they have the left mouse button pressed.</p>
  
  <p><strong>Question:</strong>  Is is possible to also capture keyboard events while capturing the mouse move event.</p>
  
  <p><strong>End Result:</strong>  I want to be able to change the mouse speed based on CTRL and SHIFT pressed.  I have the code I need to change the mouse speed, I am just wondering how I can get it so that if the user is holding CTRL while they left click and drag on the image it changes the speed.</p>
  
  <p>If anyone has any insight on this (i.e. articles, literature, or advice) that would be excellent.  Thank you and if there is any additional information needed please let me know.</p>