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'd like to remap some keys on my Mac OS X 10.7.5. Those mappings are not that trivial, for example I would like that 'W' key behaves as Return and right 'Apple cmd' behaves as Arrow down. Is that possible? I used linux previously and it was possible to map anything via xmodmap program.

share|improve this question
up vote 1 down vote accepted

Many non-alphanumeric keys or key combinations can't be changed from keylayout files or with Ukelele, but you can use KeyRemap4MacBook. Add something like this to private.xml:

<autogen>__KeyToKey__ KeyCode::W, KeyCode::RETURN</autogen>
<autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::CURSOR_DOWN</autogen>

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

share|improve this answer
do you know, where is the full key code constants list? I need to be able to map czech characters like r with caron and so. – coubeatczech Feb 12 '13 at 21:29
ř should be just KEY_5. You can add key code values with symbol_map, but most keys should have them already. If your main layout is U.S., there's no way to output ř though. You have to create a custom keylayout (with Ukelele) and change the output of keys. – user495470 Feb 12 '13 at 21:54

Ukelele works great for this! Easy and intuitive to use. Modifies the system mapping of the keyboard so no utility needs to run at boot or anything.

share|improve this answer
can you show me some example, how to map non-char keys like 'Return' to something? I tried Ukelele and there was always a need to enter a char – coubeatczech Feb 11 '13 at 23:54

xmodmap can be installed on your mac. I would use MacPorts, since I already have it set up; you might prefer to build from source manually.

share|improve this answer

You must log in to answer this question.

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