i write a given code for using navigation key but in s40 devices instead of navigation key 2,5,8 key produce the respected event
protected void keyPressed(int key) {
if (getKeyCode(DOWN) == key) {
x = x + 1;
if (x >= 3) {
x = 3;
}
repaint();
}
if (getKeyCode(UP) == key) {
x = x - 1;
if (x <= 0) {
x = 0;
}
repaint();
}
if (getKeyCode(FIRE) == key) {
if (x == 0) {
as.display.setCurrent(as.form);
}
if (x == 1) {
as.display.setCurrent(as.formm1);
}
if (x == 3) {
as.destroyApp(true);
as.notifyDestroyed();
}
}
}

Reply With Quote

