0

What I'm trying to accomplish is to intercept or change Command and replace it with Control for use while another application is running and frontmost.

Is there a way to temporarily change modifier keys on the Mac using a script?

For example, an applescript could be saved as Stay Open and would intercept a keystroke and change the keystroke to another keystroke.

1

You could use a private.xml like this with KeyRemap4MacBook:

<?xml version="1.0"?>
<root>
  <appdef>
    <appname>EMACS</appname>
    <equal>org.gnu.Emacs</equal>
  </appdef>
  <item>
    <name>test</name>
    <identifier>test</identifier>
    <only>EMACS</only>
    <autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::CONTROL_L</autogen>
    <autogen>__KeyToKey__ KeyCode::CONTROL_L, KeyCode::COMMAND_L</autogen>
    <autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::CONTROL_L</autogen>
  </item>
</root>

You must log in to answer this question.

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