Press space to write something, and press space again to delete it.
Thanks to @griffpatch for most of the code.