End Spamming

I'm training Rico to use the treat button, but he keeps pressing it. How can I stop him?