Last Updated: February 25, 2016
·
365
· ivanovb

Immediate action response for environment restoration

Long title. Simple concept.

Let's assume we have the situation where an interface has a part of it in insert mode. If we want to close the insert mode part when the user presses Escape (abort) or Enter (save), we should not wait for the keyup event, since a few default functions will be fired on keydown. And since the keypress event is actually just keydown + keyup, we can not use it also. This leaves us with keydown which has the nice side-effect that it also removes the latency between keydown - keyup and gives the impression of fast response time to the user.