please I need help - getKeyStates

J

Jeff

midp 2.0
Java SE 5.0
J2ME version 2.2

When I in my midlet pushes the 6 key on the emulator or the 6 key on my
nokia 6630, "RIGHT_PRESSED" is written to my debug window

Nothing happens when pushing the 0 key....

Here is my trouble code:
int keyState = getKeyStates();
if ((keyState & RIGHT_PRESSED) != 0) {
System.out.println("RIGHT_PRESSED");
}
if ((keyState & Canvas.KEY_NUM0) != 0) {
System.out.println("HELLO WORLD");
}

I want HELLO WORLD to be written to the debug window when I push the 0 key
and RIGHT_PRESSED when I pushes the right navigation key!

What must I change to the code to solve this????

Jeff
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top