Controlling Raspberry PI with TV Remote, using HDMI CEC

Hi,

this is an awesome script. It function perfectly, but every button will be recognized twice (except up down left right and selecet/ok).

is there an option to avoid this? - like an delay

hope you can help me

Dschogo