Implement keydown and keyup listeners