public void keyPressed()
    {
	if (!playing)
	{
	    playing = true;
	    loop();
	}

	TetrisDirection t = null;

	switch (key)
	{
	case CODED:
	    switch (keyCode)
	    {
	    case DOWN:
		// t = TetrisDirection.DOWN;
		t = TetrisDirection.RIGHT;
		break;
	    case UP:
		// t = TetrisDirection.UP;
		t = TetrisDirection.CLOCKWISE;
		break;
	    case LEFT:
		// t = TetrisDirection.LEFT;
		t = TetrisDirection.DOWN;
		break;
	    case RIGHT:
		// t = TetrisDirection.RIGHT;
		t = TetrisDirection.UP;
		break;
	    default:
		break;
	    }
	    break;
	case ' ':
	    t = TetrisDirection.ANTI_CLOCKWISE;
	    break;
	default:
	    break;
	}

	if (t != null)
	    tb.change(t, ts);
    }