This change addresses on these issues on browsers:
* Pressing cursor keys didn't work well.
This is fixed by calling trySend with true on desktops (not mobiles).
* Inputting failed just after moving a cursor.
This is fixed by resetting a session correctly.
* Sometimes pressing the enter key inserted a new line unexpectedly.
This is fixed by calling `preventDefault`.
Closes#3014