add keyboard event handler