code: @Override
  	public void handleMouseInput()
  	{
  		try
  		{
  			MOUSE_POSITION.udpate(this);
  			UIComponent component = getComponentAt(MOUSE_POSITION.x(), MOUSE_POSITION.y());
  			int button = Mouse.getEventButton();
  
  			if (Mouse.getEventButtonState())
  			{
  				if (this.mc.gameSettings.touchscreen && this.touchValue++ > 0)
  					return;
  
  				this.eventButton = button;
  				this.lastMouseEvent = Minecraft.getSystemTime();
  				this.mousePressed(component, this.eventButton);
  			}
  			else if (button != -1)
  			{
  				if (this.mc.gameSettings.touchscreen && --this.touchValue > 0)
  					return;
  
  				this.eventButton = -1;
  				this.mouseReleased(component, button);
  				this.draggedComponent = null;
  			}
  			else if (this.eventButton != -1 && this.lastMouseEvent > 0L)
  			{
  				this.mouseDragged(this.eventButton);
  			}
  
  			if (MOUSE_POSITION.hasChanged())
  			{
  				if (component != null)
  				{
  					tooltip = component.getTooltip();
  					if (component.isEnabled())
  					{
  						component.onMouseMove();
  						component.setHovered(true);
  					}
  				}
  				else
  				{
  					setHoveredComponent(null, false);
  					tooltip = null;
  				}
  			}
  
  			int delta = Mouse.getEventDWheel();
  			if (delta == 0)
  				return;
  			else if (delta > 1)
  				delta = 1;
  			else if (delta < -1)
  				delta = -1;
  
  			if (component != null && component.isEnabled())
  			{
  				component.onScrollWheel(delta);
  			}
  		}
  		catch (Exception e)
  		{
  			MalisisCore.message("A problem occured : " + e.getClass().getSimpleName() + ": " + e.getMessage());
  			e.printStackTrace(new PrintStream(new FileOutputStream(FileDescriptor.out)));
  		}
  	}
docs: Called every frame to handle mouse input.