Added distiction between key presses and key typing.