Exemplo n.º 1
0
 private void updateCursor() {
   try {
     if (mouse != null && shouldGrab()) nSetNativeCursor(getHwnd(), mouse.getBlankCursor());
     else nSetNativeCursor(getHwnd(), current_cursor);
   } catch (LWJGLException e) {
     LWJGLUtil.log("Failed to update cursor: " + e);
   }
 }
Exemplo n.º 2
0
 private void updateClipping() {
   if ((Display.isFullscreen() || (mouse != null && mouse.isGrabbed()))
       && !isMinimized
       && isFocused
       && (getForegroundWindow() == getHwnd() || hasParent)) {
     try {
       setupCursorClipping(getHwnd());
     } catch (LWJGLException e) {
       LWJGLUtil.log("setupCursorClipping failed: " + e.getMessage());
     }
   } else {
     resetCursorClipping();
   }
 }
Exemplo n.º 3
0
  private void handleMouseButton(int button, int state, long millis) {
    if (mouse != null) {
      mouse.handleMouseButton((byte) button, (byte) state, millis);

      // need to capture?
      if (captureMouse == -1 && button != -1 && state == 1) {
        captureMouse = button;
        nSetCapture(hwnd);
      }

      // done with capture?
      if (captureMouse != -1 && button == captureMouse && state == 0) {
        captureMouse = -1;
        nReleaseCapture();
      }
    }
  }
Exemplo n.º 4
0
 private void handleMouseScrolled(int amount, long millis) {
   if (mouse != null) mouse.handleMouseScrolled(amount, millis);
 }
Exemplo n.º 5
0
 private void handleMouseMoved(int x, int y, long millis) {
   if (mouse != null) {
     mouse.handleMouseMoved(x, y, millis, shouldGrab());
   }
 }
Exemplo n.º 6
0
 private void setMousePosition(int x, int y) {
   if (mouse != null) mouse.setPosition(x, y);
 }
Exemplo n.º 7
0
 public void grabMouse(boolean grab) {
   mouse.grab(grab, shouldGrab());
   updateCursor();
 }
Exemplo n.º 8
0
 public void readMouse(ByteBuffer buffer) {
   mouse.read(buffer);
 }
Exemplo n.º 9
0
 public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) {
   mouse.poll(coord_buffer, buttons);
 }
Exemplo n.º 10
0
 public void destroyMouse() {
   if (mouse != null) mouse.destroy();
   mouse = null;
 }
Exemplo n.º 11
0
 public int getButtonCount() {
   return mouse.getButtonCount();
 }
Exemplo n.º 12
0
 /* Mouse */
 public boolean hasWheel() {
   return mouse.hasWheel();
 }