Function onkeydown

    Fires when the user presses a key.