开发者

how to recognize the type of the mobile keypad (normal or QWERTY) programmatically?

开发者 https://www.devze.com 2023-02-06 05:42 出处:网络
I want to know the type of the mobile keypad programmatically. Is there any way to track this. If yes, Plea开发者_StackOverflowse guide me to get this issue ?Haven\'t tried this, so maynot work, but t

I want to know the type of the mobile keypad programmatically. Is there any way to track this. If yes, Plea开发者_StackOverflowse guide me to get this issue ?


Haven't tried this, so may not work, but try and see.

According to this link, J2ME handsets with QWERTY keyboards "almost always return their corresponding ASCII/UTF8 value [as keyCode parameter when the framework calls Canvas.keyPressed()]". So try calling something like Canvas.getKeyName(65) (i.e. the letter 'A').

If it throws IllegalArgumentException you will know that 65 is not a valid keyCode for that device, therefore it's not a QWERTY handset.

Let me know if it works!

0

精彩评论

暂无评论...
验证码 换一张
取 消