How to make [return] behave as a [return] within Messages, Skype…

Create a file (on a standard install, the directory KeyBindings doesn't exist):

mkdir ~/Library/KeyBindings

containing the following 2 remappings:

$ cat >~/Library/KeyBindings/DefaultKeyBinding.dict <<end_of_file
/* my keybindings */
{
        "\U000d" = ("insertLineBreak:") ;
        "@\U000d" = ("insertNewline:") ;
}
end_of_file

@ means cmd in this dictionary, \U000d means Unicode of the standard return (== 0x0d).

Restart Messages and from now on,

  • return will put a real return,

  • cmd+return will send the message.


Drawback

This solution is applied to any application using ~/Library/KeyBindings/DefaultKeyBinding.dict.

Advantage

This solution is applied to any application which does a non natural use of the return in a text area. Most notably I now have a Skype with which I don't send any more prematurely truncated messages.


In Messages the keyboard combination to insert "new line" is:

  • CTRL + ↩︎ Return

It will not send the message, but will insert return carriage sign (a new line).

I'm using this all the time, when writing SMS/iMessages from MacBook... but yes, not really comfortable, as way too much of accidents when you are sending the truncated messages.

In most of Applications alike Skype and other Messengers insert of new line works on next keyboard shortcuts:

  • CTRL + ↩︎ Return
  • ⌥ Option + ↩︎ Return

I do not recommend to override these shortcuts, as it's common-knowledge and standard behavior when working with Messages and Messengers.

In text processors, code editors and email editors have different behavior, as you see the big text area, and ↩︎ Return acts as a "new line" action. Modifiers alike CTRL, ⌥ Option, ⌘ Command might work as additional functionality to insert "soft" new line, to insert new page, line break delimiter, etc.


You might want to use BetterTouchTool, which is was a free utility which can disable keyboard shortcuts (and has many other uses). The list of your actions to disable/enable the shortcut could be next:

  1. Install BetterTouchTool
  2. Click on the BetterTouchTool menubar item and choose Preferences
  3. Click on Keyboard
  4. Click the plus sign at the bottom of the Select Application: pane
  5. Choose Messages (in /Applications folder)
  6. Click + Add New Shortcut
  7. Click Keyboard Shortcut, hit return
  8. Click Trigger Other Keyboard Shortcut, hit ctrl+return
  9. Leave Trigger Predefined Action: to No Action (which is the default)
  10. repeat steps 7,8 & 9 to remap cmd+return to shift+return

Which should lead to such a screen: Better Touch return remapping