only add click and keypress event when you need it