title: Getting the Keyboard Layout in WPF C#
body: <p>I need to get the Current Windows Keyboard Layout for my WPF application to map each key correctly and handle AZERTY as well as QWERTY and QWERTZ (and so on...) </p>
  
  <p>I noticed a problem since I am working with a French layout (azerty) but my windows is displayed in English.</p>
  
  <p>I tried various methods to get the layout correctly but without results : </p>
  
  <pre><code>var test1 = InputLanguageManager.Current.CurrentInputLanguage;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>var test2 = CultureInfo.CurrentCulture;
  </code></pre>
  
  <p>I tried by having ENG language with AZERTY layout, ENG language with QWERTY layout and FRA language with AZERTY layout but the output from my tests were always different. I could get the language displayed correctly (en-GB) but not the layout.</p>