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.


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

<?xml version="1.0"?>
    <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>

You must log in to answer this question.

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