Completely remap keys in Mac OS X

1


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.
Thanks

coubeatczech

Posted 2013-02-11T20:45:17.633

Reputation: 55

Answers

1

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.

Lri

Posted 2013-02-11T20:45:17.633

Reputation: 34 501

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 – 2013-02-12T21:29:43.687

1

ř 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.

– Lri – 2013-02-12T21:54:33.970

0

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.

alteredNate

Posted 2013-02-11T20:45:17.633

Reputation: 26

1can 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 – 2013-02-11T23:54:11.263

0

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.

Jerry Seeger

Posted 2013-02-11T20:45:17.633

Reputation: 248

what's the line to install it with macports package manager? and can it be installed with brew package manager? – barlop – 2020-01-12T23:10:43.077