Im trying to make a separate class that would handle the event when keyboard button is pressed or mouse is moved or clicked. But i cannot seem to find a function that would just detect if any button is pressed or held down or if mouse is moved or clicked. .next() does not support the holding button down.

So what would be a good solution to this? Many buttons can be held down at the same time. What could be a good way to detect that event is happened? Or would it be better if just detect what button has been pressed and then send it to wherever it will be used to to some calculations?

Java Code:
while( || Mouse.getEventButton() != -1){
				position = control.position;
				rotation = control.rotation;