Making keydown handling nicer