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