code: public boolean isButtonPressed(int index, int controller) {
  		if (controller >= getControllerCount()) {
  			return false;
  		}
  
  		if (controller == ANY_CONTROLLER) {
  			for (int i=0;i<controllers.size();i++) {
  				if (isButtonPressed(index, i)) {
  					return true;
  				}
  			}
  			
  			return false;
  		}
  		
  		return ((Controller) controllers.get(controller)).isButtonPressed(index);
  	}
docs: Check if controller button is pressed
  
  @param controller The index of the controller to check
  @param index The index of the button to check
  @return True if the button is pressed