I’m polling the mouse events and iterating through them using the following code …
mouse.poll();
EventQueue queue = mouse.getEventQueue();
Event event = new Event();
while(queue.getNextEvent(event)){
//Removed code using println() for testing purposes only.
System.out.println(event.getComponent().getIdentifier() + ", " + event.getComponent().getPollData());
//More removed code.
}
I’m getting the following results:
x, -43.0
x, -43.0
x, 42.0
x, 42.0
x, 42.0
…etc etc.
where in reality the mouse only moved -43 units one time and then +42 units one more time. Anyone know a workaround or if there is a better method for using JInput to track relative mouse location. ( Would prefer to use the events instead of mouse.getX().getPollData(); )
Thanks!