开发者

how to handle keypressed event in canvas for alphanumeric using j2me midp2.0?

开发者 https://www.devze.com 2023-01-31 18:24 出处:网络
I am using canvas for drawing Strings in mobile screen based on开发者_C百科 the user input using key pressed event. Here my user wants to enter alphanumeric character like abc. For example user try to

I am using canvas for drawing Strings in mobile screen based on开发者_C百科 the user input using key pressed event. Here my user wants to enter alphanumeric character like abc. For example user try to enter 'd' then it will display 3 instead of 'd'. So, do I get both String and numeric and able to draw in the mobile screen?


Na if you're doing it in Canvas, you'll need to implement your own typing. I guess you'll have a 2D array of characters for each number. [['a', 'b', 'c'], ['d', 'e', 'f']...

You'll also need to implement a timeout after which you move on to the next character.

Not to mention detecting if the user has a QWERTY keyboard (Nokia E71 etc).

Basically, you have to implement it all yourself; there's no shortcut for this.

0

精彩评论

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