diff options
author | Erik De Rijcke <Erik.De.Rijcke@prodatamobility.com> | 2015-03-17 17:22:10 +0100 |
---|---|---|
committer | Erik De Rijcke <Erik.De.Rijcke@prodatamobility.com> | 2015-03-17 17:22:10 +0100 |
commit | 71817ea974908565fb3c30b5732f40095e774864 (patch) | |
tree | 74108eefab3b53cd5efc5a1c265edd36cc80038a | |
parent | 59241eaa52505710a912611807cd17e04f9c25ec (diff) |
add some event printing
-rw-r--r-- | examples/src/main/java/examples/Window.java | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/examples/src/main/java/examples/Window.java b/examples/src/main/java/examples/Window.java index 1cc3f1b..ec20fb8 100644 --- a/examples/src/main/java/examples/Window.java +++ b/examples/src/main/java/examples/Window.java @@ -96,13 +96,20 @@ public class Window implements WlShellSurfaceEvents, @Nonnull final WlSurfaceProxy surface, @Nonnull final Fixed surfaceX, @Nonnull final Fixed surfaceY) { - + System.out.println(String.format("Pointer - enter : serial=%d, surface=%s, x=%s, y=%s", + serial, + surface, + surfaceX, + surfaceY)); } @Override public void leave(final WlPointerProxy emitter, final int serial, @Nonnull final WlSurfaceProxy surface) { + System.out.println(String.format("Pointer - leave : serial=%d, surface=%s", + serial, + surface)); } @Override @@ -110,6 +117,10 @@ public class Window implements WlShellSurfaceEvents, final int time, @Nonnull final Fixed surfaceX, @Nonnull final Fixed surfaceY) { + System.out.println(String.format("Pointer - motion : time=%d, x=%s, y=%s", + time, + surfaceX, + surfaceY)); } @Override @@ -118,6 +129,12 @@ public class Window implements WlShellSurfaceEvents, final int time, final int button, final int state) { + System.out.println(String.format("Pointer - button : serial=%d, time=%d, button=%d, state=%d", + serial, + time, + button, + state)); + final boolean buttonPressed = state == WlPointerButtonState.PRESSED.getValue(); if (buttonPressed && button == 1) { this.shellSurfaceProxy.move(display.getSeatProxy(), @@ -134,12 +151,18 @@ public class Window implements WlShellSurfaceEvents, final int time, final int axis, @Nonnull final Fixed value) { - + System.out.println(String.format("Pointer - axis : time=%d, axis=%d, value=%s", + time, + axis, + value)); } @Override public void ping(final WlShellSurfaceProxy emitter, final int serial) { +// System.out.println(String.format("shell surface - ping : serial=%d", +// serial)); + emitter.pong(serial); } |