title: How to get keyboard layout in Mac OS X with C/C++
body: <p>I need to get the keyboard layout being used on Mac OS X. I've found old restonces to this but they all are something like this:</p>
  <p><a href="https://stackoverflow.com/questions/3338781/how-to-change-the-mac-os-x-keyboard-layout-programmatically">How to change the Mac OS X Keyboard Layout programmatically?</a></p>
  <p>which doesn't work any more. Any help would be much appreciated.</p>