0

I'm using Mac OS X operating system with bash shell and I'm really tired to change keyboard layout every time I switch to shell. Does anyone know how to automatically set english layout after switching to shell?

1 Answers1

1

There is an option to use a different input source for each document (or sometimes window or application) in System Preferences:

It won't probably be useful in this case though.

You could make pressing F5 focus Terminal and switch to an English input source by using a private.xml like this with KeyRemap4MacBook:

<?xml version="1.0"?>
<root>
  <vkopenurldef>
    <name>KeyCode::VK_OPEN_URL_Terminal</name>
    <url>file:///Applications/Utilities/Terminal.app</url>
  </vkopenurldef>
  <item>
    <name>test</name>
    <identifier>test</identifier>
    <autogen>__KeyToKey__ KeyCode::F5, KeyCode::VK_OPEN_URL_Terminal,
    KeyCode::VK_CHANGE_INPUTMODE_ENGLISH</autogen>
  </item>
</root>

I don't know how to change the input source back when focusing another application though.

See the source for the key code values and predefined settings.

Related questions:

Lri
  • 41,444