public static void  pressKey(MoveType t) {

    try { 
      switch (t) {       
        case UP:    type(KeyEvent.VK_UP);
          break;
        case DOWN:  type(KeyEvent.VK_DOWN);
          break;
        case LEFT:  type(KeyEvent.VK_LEFT);
          break;
        case RIGHT: type(KeyEvent.VK_RIGHT);
          break;
        case SHIFT: type(KeyEvent.VK_SHIFT);
          break;
        case SPACE: type(KeyEvent.VK_SPACE);
          break;
        case CTRL:  type(KeyEvent.VK_CONTROL);
          break;
        case CLICK: // left click
          robot.mousePress(InputEvent.BUTTON1_MASK);
          robot.delay(200);
          robot.mouseRelease(InputEvent.BUTTON1_MASK);
          robot.delay(200);
          break;
      }

      System.out.println(t.toString());
      
	    
    } catch (Throwable trw)
    {
      trw.printStackTrace();
    }
  }