3

On a Mavericks system, I would like to use Ctrl+left/Ctrl+right instead of Alt+left/Alt+right to move to the next word or the previous word.

Mission Control is not using Ctrl+left/Ctrl+right (I changed that from the default value).

Is it possible to do this with some system setting (i.e. without a keymapper)?

1

You can use KeyRemap4MacBook with a private.xml such as this:

<?xml version="1.0"?>
<root>
  <item>
    <name>⌃← & ⌃→ to ⌥← & ⌥→</name>
    <identifier>remapCtrlLeftAndCtrlRightToAltLeftAndAltRight</identifier>
    <autogen>
      __KeyToKey__
      KeyCode::CURSOR_LEFT, VK_CONTROL | ModifierFlag::NONE,
      KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L
    </autogen>
    <autogen>
      __KeyToKey__
      KeyCode::CURSOR_RIGHT, VK_CONTROL | ModifierFlag::NONE,
      KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L
    </autogen>
  </item>
</root>

I'm not aware of any System Preferences setting regarding this.


With regard to comment, change the contents of the <autogen> to…

__KeyToKey__
KeyCode::CURSOR_LEFT, VK_OPTION | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::CONTROL_L
__KeyToKey__
KeyCode::CURSOR_RIGHT, VK_OPTION | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::CONTROL_L
  • OK, I see it is not possible to do it without a Remapper. Just a quick mention that I actually needed Alt-Left and Alt-Right to Ctrl+Left and Ctrl+Right, so I guess that simply swapping the KeyCode:: lines should do the trick. – Pep Jan 2 '14 at 18:44
  • @Pep Not quite as easy as swapping the entire line, just the second parameter of each — see edit. – grg Jan 2 '14 at 18:46
1

Another option is to create ~/Library/KeyBindings/ and save a property list like this as ~/Library/KeyBindings/DefaultKeyBinding.dict:

{
   "^\UF700" = moveWordUp:;
   "^\UF701" = moveWordDown:;
   "^\UF702" = moveWordLeft:;
   "^\UF703" = moveWordRight:;
   "^$\UF700" = moveWordUpAndModifySelection:;
   "^$\UF701" = moveWordDownAndModifySelection:;
   "^$\UF702" = moveWordLeftAndModifySelection:;
   "^$\UF703" = moveWordRightAndModifySelection:;
}

Quit and reopen applications to apply the changes.

More information:

  • I like this solution because it does not require any additional software, and instead relies on Apple's built-in functionality. I also added "^\U007F" = deleteWordBackward:; to map ctrl+backspace to delete word. – Jordan Mack Mar 4 '14 at 22:41

You must log in to answer this question.

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