@Override public Queue<MouseAction> getInputQueue() { Queue<MouseAction> result = Queues.newArrayDeque(); while (Mouse.next()) { if (Mouse.getEventButton() != -1) { ButtonState state = (Mouse.getEventButtonState()) ? ButtonState.DOWN : ButtonState.UP; result.add(new MouseAction(InputType.MOUSE_BUTTON.getInput(Mouse.getEventButton()), state, getPosition())); } if (Mouse.getEventDWheel() != 0) { int id = (Mouse.getEventDWheel() > 0) ? 1 : -1; result.add(new MouseAction(InputType.MOUSE_WHEEL.getInput(id), id * Mouse.getEventDWheel() / 120, getPosition())); } } return result; }
if (Mouse.getEventDWheel() != 0) { event.type = TouchEvent.TOUCH_SCROLLED; event.scrollAmount = (int)-Math.signum(Mouse.getEventDWheel()); } else if (pressedButtons.size > 0) { event.type = TouchEvent.TOUCH_DRAGGED;
if (Mouse.getEventDWheel() != 0) { event.type = TouchEvent.TOUCH_SCROLLED; event.scrollAmount = (int)-Math.signum(Mouse.getEventDWheel()); } else if (pressedButtons.size > 0) { event.type = TouchEvent.TOUCH_DRAGGED;
int btn = Mouse.getEventButton(); int wheelDelta = Mouse.getEventDWheel(); int xDelta = Mouse.getEventDX(); int yDelta = Mouse.getEventDY();
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); if(Mouse.getEventButton() == 0) swiped = false; int w = Mouse.getEventDWheel(); if(w < 0) nextPage(); else if(w > 0) prevPage(); }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); if(Mouse.getEventButton() == 0) swiped = false; int w = Mouse.getEventDWheel(); if(w < 0) nextPage(); else if(w > 0) prevPage(); }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); final int i = Mouse.getEventDWheel(); if( i != 0 && isShiftKeyDown() ) { final int x = Mouse.getEventX() * this.width / this.mc.displayWidth; final int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; this.mouseWheelEvent( x, y, i / Math.abs( i ) ); } else if( i != 0 && this.getScrollBar() != null ) { this.getScrollBar().wheel( i ); } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); //System.out.println(Mouse.getEventDWheel()); zoom = initZoom + Mouse.getEventDWheel() / 2; if (zoom < -200) zoom = -200; if (zoom > 1000) zoom = 1000; //System.out.println(zoom); }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); if (Mouse.hasWheel() && Mouse.getEventDWheel() != 0) { if (Math.signum(Mouse.getEventDWheel()) < 0) { scrollDown(); } else { scrollUp(); } } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); if (usesWheel) { int wheelMove = Mouse.getEventDWheel(); if (wheelMove != 0 && this.visible) { wheelMove = wheelMove > 0 ? -1 : 1; doSetScrollPos(scrollPos + wheelMove * scrollStep); } } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); int d = Mouse.getEventDWheel(); if (scrollbar != null && d != 0) { scrollbar.wheel(d); } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); int w = Mouse.getEventDWheel(); int max = getPageCount(); if(w != 0) { int next = page - w / Math.abs(w); if(next >= 0 && next < max) { page = next; updatePanelButtons(); } } }
@Override public void handleMouseInputSub() throws IOException { getActiveTab().onMouseScroll(Mouse.getEventDWheel()); super.handleMouseInputSub(); }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); int w = Mouse.getEventDWheel(); if(w < 0) changePage(false, true); else if(w > 0) changePage(true, true); }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); if (editMenu != null) { int x = (Mouse.getEventX() * this.width / this.mc.displayWidth) - left; int y = (this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1) - top; int scroll = Mouse.getEventDWheel(); if (scroll != 0) { editMenu.onScroll(this, x, y, scroll); } } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth; int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; int scroll = Mouse.getEventDWheel(); if(scroll != 0) { if(windows[0] != null) { windows[0].handleMouseScroll(mouseX, mouseY, scroll >= 0); } } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); int mouseX = Mouse.getEventX() * width / mc.displayWidth; int mouseY = height - Mouse.getEventY() * height / mc.displayHeight - 1; int wheelChange = Mouse.getEventDWheel(); if (canInputGlasses()) { glassesMouse.update(mouseX, mouseY, wheelChange); } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); final int i = Mouse.getEventDWheel(); if (i != 0 && isShiftKeyDown()) { final int x = Mouse.getEventX() * width / mc.displayWidth; final int y = height - Mouse.getEventY() * height / mc.displayHeight - 1; mouseWheelEvent(x, y, i / Math.abs(i)); } else if (i != 0 && getScrollBar() != null) { getScrollBar().wheel(i); } }
@Override public void handleMouseInput() throws IOException { final int x = Mouse.getEventX() * width / mc.displayWidth; final int y = height - Mouse.getEventY() * height / mc.displayHeight - 1; if (isMouseOver(x, y)) { int scrollDelta = Mouse.getEventDWheel(); if (scrollDelta < 0) { logic.nextPage(); return; } else if (scrollDelta > 0) { logic.previousPage(); return; } } super.handleMouseInput(); }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); int x = Mouse.getEventX() * this.width / this.mc.displayWidth; int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; int button = Mouse.getEventButton(); boolean state = Mouse.getEventButtonState(); int wheel = Mouse.getEventDWheel(); int type = button >= 0 ? (state ? Listener.MOUSE_DOWN : Listener.MOUSE_UP) : wheel != 0 ? Listener.MOUSE_WHEEL : Listener.MOUSE_MOVED; ActivationEvent evt = new ActivationEvent(type, button, state, x, y, wheel); for (GuiElement element : this.elements) { element.handleMouseInput(evt); } }