Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know how to change the keyboard layout in general, but I want certain applications to always open with a specific layout, not the same for all of them. For example, I'd like Firefox to open with a Spanish layout, but Mathematica with a US layout. How can I do this?

I'm using Snow Leopard

share|improve this question
See also… – user31752 Sep 16 '10 at 2:14

I think the easiest solution is to add a bit of manual work and do it as follows:

  • Turn on the languages you want in System Prefs > Language & Text > Input Sources
  • Under "Input source options" select the "Allow a different one for each document"
  • Set up a keyboard shortcut to change keyboard layout
  • Launch your app, change your keyboard layout, and it will only be changed for that window.
  • If you bring up a new firefox window, you'll need to re-select the language for that new window.

To answer your specific desire to have apps open in one layout:

  • Set the "Allow a different one for each document" as directed above.
  • Find out how to change the layout via script. Solutions seem available...
  • Make a new launcher (AppleScript) for Firefox that launches Firefox, then runs the keyboard changer after a delay (when you are sure Firefox is open and in front).
  • Perhaps this is good enough as doing it at launch meets your needs. If not, run it continuously as @pattern86 suggested
share|improve this answer
Thank you! I've looking for a way to do this for a couple months now. Safari would always switch the keyboard layout on its own, drove me nuts. – Ory Band Jan 6 '13 at 16:39
This answer is outdated! There is no such option for Yosemite. check mine answer: – skywinder Mar 19 '15 at 17:58

I suggest you to try Keyboard pilot.

The app is sold in Mac OS App Store for a small price. It allows you to set a list of app->layout pairs which forces active layout to change when the specified app gains focus.

share|improve this answer
Hi Gleb! Could you please expand your answer and explain how it solves the problem, what it does, etc.? – slhck Oct 16 '12 at 13:33
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – MaQleod Oct 16 '12 at 15:39
I had this same problem, and went ahead and bought keyboard pilot and it indeed solved the problem, it just switches the layout when you switch applications. – Guillermo Siliceo Trueba Jan 16 '14 at 19:56

The top-voted answer is outdated! There is no such option for Yosemite.

I found great and free application, that resolve this issue: Auto Keyboard

By this app you can specify default language for any specific app - simply awesome!

share|improve this answer
Maybe once it was free but now it's not – Evmorov May 7 at 10:25

You can write an Applescript that constantly runs and checks if an app has focus and if it does then it sets the keyboard layout to one layout and when it detects that the app doesn't have focus it switches the layout back again. Have it run at login.

I can't help with writing the app, but that would be the solution.

Here are a couple of related articles that I found:

share|improve this answer

I suggest you to try Keyboard Maestro at

By this app you can specify default input source for any specific app - simply awesome!

Check my screenshot:

enter image description here

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .