J2ME - different keyNames for different device vendors

L

lberridge

Hi all.

I've been trying to find a list that describes the vendor-specific results
for getKeyName() for each key on Java-enabled phones. For example,
keyCode -8 on a Nokia 7650 is called "Clear Key". On a Sony Ericsson T610,
keyCode -8 is called "CLEAR". This is a happy coincidence, I guess, because
there doesn't even seem to be a specification or guideline that suggests
that keyCode -8 should be a clear button (or that if you support a clear
button, it should be keyCode -8). Is there?

I've downloaded 10 phone emulators, and clicked each button while running a
diagnostic program I wrote, and have been appalled by the subtle differences
in implementation. There *has* to be a better way.

Does anyone know where to find this resource? Or maybe a JAR that can do
some translations by detecting the type of phone it's running on and using a
"standardised" LUT?

Cheers,
Grant.
 
D

Darryl L. Pierce

lberridge said:
I've been trying to find a list that describes the vendor-specific results
for getKeyName() for each key on Java-enabled phones. For example,
keyCode -8 on a Nokia 7650 is called "Clear Key". On a Sony Ericsson
T610,
keyCode -8 is called "CLEAR". This is a happy coincidence, I guess,
because there doesn't even seem to be a specification or guideline that
suggests that keyCode -8 should be a clear button (or that if you support
a clear
button, it should be keyCode -8). Is there?

I've downloaded 10 phone emulators, and clicked each button while running
a diagnostic program I wrote, and have been appalled by the subtle
differences
in implementation. There *has* to be a better way.

There's no standard for any buttons other than 0-9, *, #, navigation keys,
the 4 game buttons and the fire button. Since not all buttons are present
on all devices, why would there be a standard defined for them?
Does anyone know where to find this resource? Or maybe a JAR that can do
some translations by detecting the type of phone it's running on and using
a "standardised" LUT?

I had written a while back a simple MIDlet that would just take the keyCode
value and display it, along with the associated game action if one existed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top