如何使用j2me midp2.0在画布中为字母数字处理按键事件? [英] how to handle keypressed event in canvas for alphanumeric using j2me midp2.0?

查看:101
本文介绍了如何使用j2me midp2.0在画布中为字母数字处理按键事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用画布在基于按键事件的用户输入的基础上在移动屏幕上绘制字符串.我的用户在这里要输入字母数字字符,如abc.例如,用户尝试输入"d",那么它将显示3而不是"d".那么,我既可以获取字符串也可以获取数字,并且可以在移动屏幕上进行绘制吗?

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?

推荐答案

如果在Canvas中进行操作,则需要实现自己的键入.我想您每个数字都会有一个二维字符数组. [['a', 'b', 'c'], ['d', 'e', 'f']...

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.

更不用说检测用户是否具有QWERTY键盘(诺基亚E71等).

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.

这篇关于如何使用j2me midp2.0在画布中为字母数字处理按键事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆