T
Tor Iver Wilhelmsen
I run the following little thingy in a midlet, but I only get key
codes for the keys 1, 3, 0, "back" and "C". Is there a reason other
keys don't report anything?
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.game.GameCanvas;
public class KeyScanner extends GameCanvas {
public KeyScanner() {
super(true);
}
public void keyPressed(int keyCode) {
Graphics g = getGraphics();
int x = getWidth(), y = getHeight();
g.setColor(0xffffff);
g.fillRect(0, 0, x, y);
g.setColor(0x000099);
g.drawString(String.valueOf(keyCode), x/2, y/2, 0);
flushGraphics();
}
}
codes for the keys 1, 3, 0, "back" and "C". Is there a reason other
keys don't report anything?
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.game.GameCanvas;
public class KeyScanner extends GameCanvas {
public KeyScanner() {
super(true);
}
public void keyPressed(int keyCode) {
Graphics g = getGraphics();
int x = getWidth(), y = getHeight();
g.setColor(0xffffff);
g.fillRect(0, 0, x, y);
g.setColor(0x000099);
g.drawString(String.valueOf(keyCode), x/2, y/2, 0);
flushGraphics();
}
}