KeyCodes in J2ME Canvas
When you develop an application with your own graphic framework (that is creating graphic items without using the standard ones like Form, TextBox and so on) one of the most important task is catching the key events in the Canvas class.
Despite the Java claim (Write once, run everywhere), the J2ME world has an incredible fragmentation and one of the field affected by this problem is right the key codes catching. Unfortunately, both phone manufacturer and operators are guilty. In my work experience I have found some phone models which have different key codes than the same devices but branded by operators.
Sometimes developers choose to sacrifice the appeal of his application to avoid this kind of problems. We have already talked about the automatic
recognizing of left and right softkeys or of the
"Clear" button in previous articles.
Here, we are going to see an overview about the different codes used by some manufacturer in their phone models. The table is shown in a
J2ME Forum article.