Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 superuser.com/questions/173494/… –  user31752 Sep 16 '10 at 2:14
add comment

3 Answers

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
add comment

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
add comment

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
5  
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 at 19:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.