The addon
Prat can do this.
Here's a screenshot below of where the setting is. You may need to enable "Editbox" in the Module Control tab, where I put the question mark. Click the screenshot for full size.
If you don't want a full chat addon just for this function, you can disable everything but the Editbox in the Module Control and the Editbox will be the only thing it does.