Get any keypress but allowed

I used the solution offered by @dvbridges in this topic and, even though I had to specify all possible combinations I predict (not so many in my case), it’s working perfectly.
Thanks
Felipe