Well, as I said before. Can't check it on my device, it's a Windows Laptop without a NUMPAD. Maybe others can check your code with matching hardware. Most of them will use Windows as Operating System.
I can see in your code, you do a "translation" for getting a match. Best what you can do.
Next step is to check, if this is depending on Operating System (Windows vs. Android vs. ChromeOS). Hope for you this behave is standard on ChromeOS, then you fixed it already with the translation in your code and you are able to run this code on every ChromeOS driven machine.
Be careful. I read that the follower ChromOs Flex does not support native Android Applications. And again. I can't prove that.
Hope my thoughts helped you in finding a solution. If it works, well done. Test your code on different machines if possible!