int getKeyFlag(int code){
        switch(canvas.getGameAction(code)){
        case Canvas.UP: return GameCanvas.UP_PRESSED;
        case Canvas.DOWN: return GameCanvas.DOWN_PRESSED;
        case Canvas.LEFT: return GameCanvas.LEFT_PRESSED;
        case Canvas.RIGHT: return GameCanvas.RIGHT_PRESSED;
        case Canvas.FIRE: return GameCanvas.FIRE_PRESSED;
        case Canvas.GAME_A: return GameCanvas.GAME_A_PRESSED;
        case Canvas.GAME_B: return GameCanvas.GAME_B_PRESSED;
        case Canvas.GAME_C: return GameCanvas.GAME_C_PRESSED;
        case Canvas.GAME_D: return GameCanvas.GAME_D_PRESSED;
        }
        return 0;
    }