В яве это делается примерно так (цитата из доков):
// Check user input and update positions if necessary
int keyState = getKeyStates();
if ((keyState & LEFT_PRESSED) != 0) {
sprite.move(-1, 0);
}
else if ((keyState & RIGHT_PRESSED) != 0) {
sprite.move(1, 0);
}
Если в паскале есть битовые операции, то можно и в нём аналогично. Значения констант:
javax.microedition.lcdui.game.GameCanvas
public static final int DOWN_PRESSED 64
public static final int FIRE_PRESSED 256
public static final int GAME_A_PRESSED 512
public static final int GAME_B_PRESSED 1024
public static final int GAME_C_PRESSED 2048
public static final int GAME_D_PRESSED 4096
public static final int LEFT_PRESSED 4
public static final int RIGHT_PRESSED 32
public static final int UP_PRESSED 2