OSX 10.9.5 - different keyboard layouts per application
I use the keyboard switching as well.

To do that I just click on the menu bar Input source name Icon and select the keyboard I need.



That assumes you set the Input Sources in your sys pref key board, and you can choose the Automatically switch to documents input source as well if you prefer.

Auto switch:


  Choose an input source for a document and have it used every time you
  work in the document until you close it, even if you switch to other
  documents that use other input sources in the meantime.
  
  This option appears only when you add a second input source.