Beispiel #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);
   }
 }
Beispiel #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();
   }
 }
Beispiel #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();
      }
    }
  }
Beispiel #4
0
 private void handleMouseScrolled(int amount, long millis) {
   if (mouse != null) mouse.handleMouseScrolled(amount, millis);
 }
Beispiel #5
0
 private void handleMouseMoved(int x, int y, long millis) {
   if (mouse != null) {
     mouse.handleMouseMoved(x, y, millis, shouldGrab());
   }
 }
Beispiel #6
0
 private void setMousePosition(int x, int y) {
   if (mouse != null) mouse.setPosition(x, y);
 }
Beispiel #7
0
 public void grabMouse(boolean grab) {
   mouse.grab(grab, shouldGrab());
   updateCursor();
 }
Beispiel #8
0
 public void readMouse(ByteBuffer buffer) {
   mouse.read(buffer);
 }
Beispiel #9
0
 public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) {
   mouse.poll(coord_buffer, buttons);
 }
Beispiel #10
0
 public void destroyMouse() {
   if (mouse != null) mouse.destroy();
   mouse = null;
 }
Beispiel #11
0
 public int getButtonCount() {
   return mouse.getButtonCount();
 }
Beispiel #12
0
 /* Mouse */
 public boolean hasWheel() {
   return mouse.hasWheel();
 }