Disable keys

I am developing a puzzle game in version 4.19. I included in the game the virtual android keyboard via widget. I’m trying to disable some keys but I can not. I have tried some tips made here in answerHub, but I have not been successful so far. Thanks to anyone who can help.