How to see what programs are using keyboard Is there a way to find which program uses the keyboard to input stuff?

Why I am asking this question is because my laptop (MacBook Pro) keeps inputting 0 key, my lap works fine after 5 mins from login and this happens all the time, I tried to run a command that disables the keypad but, it doesn't solve the problem, so I concluded that this was a virus, so please help me on this.
Sorry for wasting your time it was a keyboard problem