When enter is pressed and a textarea is selected sendMessage is called.
Added some comments to make the code easier to read.