You just discovered (by accident) the power of vim-mode, which if turned on by accident without learning it, can be really annoying.
Vim allows for every key in your keyboard to be a shortcut, hjkl work like the arrows.
h is ←
j is ↓
k is ↑
l is →
i is insert mode. This means that you can start writing once you click i and when you press esc you get back to vim mode.
when you press random keys you end up pressing i or a and then you are in writing mode.
d and x delete things so you where accidently pressing them too.
I highly recommend learning it, since it can allow for some really quick text editing experience. But of course right now it’s being annoying, so for now just turn it off.
Go to:
Settings > Editor > (scroll down to the bottom) “Vim Key bindings”
turn it off.
That solves it!