Hi,
Thank you very much for your comment.
I was working on the controls for a long time, and after trying different approches , I finally implemented a system that changes the amount of times that the keyboard is checked depending on the speed of the pill... but, you are right sometimes the keyboard scan is too quick and the pill moves two positions at a time.
I will try to have a look at it again , in order to check if I can do something to avoid this.
Regards.