Writing keyboard handler. The key pressing is not constant. It is pressed and stops.