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