directive handling key events