Have to use LWJGL with a touch screen

Started by napier, September 27, 2005, 07:26:06

Previous topic - Next topic

napier

I need to get LWJGL running on a touchscreen.  I have code like this to read mouse events:

       int mouseDX = Mouse.getDX();
        int mouseDY = Mouse.getDY();
        if (mouseDX != 0 || mouseDY != 0 || mouseDW != 0) {
            cursorX += mouseDX;
            cursorY += mouseDY;


this doesn't work with touch screen because the user can pick up their finger and place it anywhere.  The mouse always gives continuous delta XY coords, but the touch screen can jump all over, screwing up the delta xy approach.

I need to get absolute screen xy position of input events.  I tried Mouse.getEventX() but it always returns 0.  Is there a way to get absolute xy?
penGL/Java/LWJGL demos and code: http://potatoland.org/code/gl

elias

getEventX/Y should work if you use Mouse.next(). Alternatively, use getX/Y().

- elias