From what I see in the Googles, there used to be a way to set it so that each application/window could have its own keyboard layout. I have two different apps, and I need different layouts for each one (Dvorak for one, and US for the other).
It seems like that feature may have been removed sometime between the stuff I'm seeing in Google and the current 10.9.5 version. Is there another way to accomplish this now?