I also have a question about mouse input.
I can’t seem to get the correct relative mouse position.
if I use event queue for the mouse it almost works, but when I hold my mouse still I still get realtive movemnt of atleast 1.0f;
if I use this approatch:
m_mouse.poll();
m_deltaMouse.x = m_mouse.getX().getPollData()
m_deltaMouse.y = m_mouse.getY().getPollData()
the values are constant 0.0 in both X and Y.
I use windows xp.
my test app looks like this:
public static void main( String[]args)
{
JFrame f = new JFrame("This is a test");
f.setSize(1024, 768);
Container content = f.getContentPane();
content.setBackground(Color.white);
f.addWindowListener(new ExitListener());
f.setVisible(true);
while( true )
{
Input.getInstance().capture();
//Keyboard works fine
if( Input.getInstance().getKeyboard().isKeyDown(Identifier.Key.Q))
{
System.exit(0);
break;
}
//event mode work's poor, "imidate" mode don't work at all"
System.out.println("delta mouse x : "+Input.getInstance().getMouse().getDelta().x );
System.out.println("delta mouse y : "+Input.getInstance().getMouse().getDelta().y );
//Mouse has no dead zone....
System.out.println("\ndead zone x : "+Input.getInstance().getMouse().getDeadZone().x );
System.out.println("\ndead zone y : "+Input.getInstance().getMouse().getDeadZone().y );
}
}
}
class ExitListener extends WindowAdapter {
public void windowClosing(WindowEvent event)
{
System.exit(0);
}
}
btw: I don’t check mouse and keyboard poll in the same loop, does the getEventQueue() “steal events”, feels likt that’s not the case ???