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

你离开我真会死。 提交于 2019-12-22 18:13:11

问题


I am using canvas for drawing Strings in mobile screen based on 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?


回答1:


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.



来源:https://stackoverflow.com/questions/4517767/how-to-handle-keypressed-event-in-canvas-for-alphanumeric-using-j2me-midp2-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!