Change the Option+R/L shortcuts to Control+R/L
In the first example below Option-L/R arrow does the same after adjusting the keycodes as Control-L/R arrow.
The previous behavior Option-L/R arrow (e.g opening/closing a folder in list view) is lost.
If you want a different behavior you have to modify/precise your answer.
To make this work you have to use a third party tool: Karabiner.
- Download, install and open Karabiner
- Open in the menulet Karabiner -> Preferences
- Open the tab Misc & Uninstall
- Hit the button Open private.xml
- Open the file private.xml with an appropriate editor
-
Enter the customized keycode
<?xml version="1.0"?> <root> <item> <name>Change Option L/R arrow to Control L/R arrow</name> <identifier>altlr2ctrllr</identifier> <autogen>__KeyToKey__ KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION, KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL</autogen> <autogen>__KeyToKey__ KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION, KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL</autogen> </item> </root>
Save the file
- Open in the menulet Karabiner -> Preferences the tab Change Key
- Hit the ReloadXML button
- Enable the remapping. It should be listed at the beginning.
And if you are really asking for "Option+L/R shortcut on my Mac keyboard to Control+R/L" - which can be read as alt-l to ctrl-r and alt-r to ctrl-l in contrary to the headline - then use
<autogen>__KeyToKey__ KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION, KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL</autogen>
<autogen>__KeyToKey__ KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION, KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL</autogen>
If you want the opposite (Control-L/R arrow does the same as Option-L/R arrow) use this snippet instead. The previous behavior of Control-L/R arrow is lost.
<?xml version="1.0"?>
<root>
<item>
<name>Change Control L/R arrow to Option L/R arrow</name>
<identifier>ctrllr2altlr</identifier>
<autogen>__KeyToKey__ KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION</autogen>
<autogen>__KeyToKey__ KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION</autogen>
</item>
</root>
If you want to swap ctrl-L/R-arrow with ctrl-L/R-arrow then use either both of the above keycode changes or this one:
<?xml version="1.0"?>
<root>
<item>
<name>Swap Control L/R arrow and Option L/R arrow</name>
<identifier>swap_ctrllrarrow_altlrarrow</identifier>
<autogen>__KeyToKey__ KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION, KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL</autogen>
<autogen>__KeyToKey__ KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION, KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL</autogen>
<autogen>__KeyToKey__ KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_LEFT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION</autogen>
<autogen>__KeyToKey__ KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION</autogen>
</item>
</root>
My knowledge of keyboard bindings is that it's difficult to do without installing third party applications. With that said, Karabiner (formerly KeyRemap4MacBook) provides a great way of customizing bindings easily, and should be able to do what you want.