events++; int x = (int)(Mouse.getEventX() * Display.getPixelScaleFactor()); int y = Gdx.graphics.getHeight() - (int)(Mouse.getEventY() * Display.getPixelScaleFactor()) - 1; int button = Mouse.getEventButton(); int gdxButton = toGdxButton(button);
events++; int x = (int)(Mouse.getEventX() * Display.getPixelScaleFactor()); int y = Gdx.graphics.getHeight() - (int)(Mouse.getEventY() * Display.getPixelScaleFactor()) - 1; int button = Mouse.getEventButton(); int gdxButton = toGdxButton(button);
@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(); int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth; int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; soundList.handleMouseInput(mouseX, mouseY); }
@Override public void handleMouseInput() throws IOException { int x = Mouse.getEventX() * width / mc.displayWidth; int y = height - Mouse.getEventY() * height / mc.displayHeight - 1; mouseX = x - guiLeft; mouseY = y - guiTop; mouseWheel = Mouse.getDWheel(); super.handleMouseInput(); } }
@Override public void handleMouseInput() throws IOException { int x = Mouse.getEventX() * width / mc.displayWidth; int y = height - Mouse.getEventY() * height / mc.displayHeight - 1; mouseX = x - guiLeft; mouseY = y - guiTop; mouseWheel = Mouse.getDWheel(); super.handleMouseInput(); }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); if(activeTab == 1) { int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth; int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; if (this.guiWhiteList != null) { this.guiWhiteList.handleMouseInput(mouseX, mouseY); } } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); int x = Mouse.getEventX() * width / mc.displayWidth; int y = height - Mouse.getEventY() * height / mc.displayHeight - 1; terminalGui.handleMouseInput(x, y); }
@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 protected void drawStackTooltips(int mouseX, int mouseY) { int x = Mouse.getEventX() * width / mc.displayWidth; int y = height - Mouse.getEventY() * height / mc.displayHeight - 1; Widget<?> widget = window.getToplevel().getWidgetAtPosition(x, y); if (widget instanceof BlockRender) { if ("block".equals(widget.getUserObject())) { //System.out.println("GuiController.drawStackTooltips"); return; // Don't do the normal tooltip rendering } } super.drawStackTooltips(mouseX, mouseY); } }
@Override public void handleMouseInput() throws IOException { int mouseX = Mouse.getEventX() * width / mc.displayWidth; int mouseY = height - Mouse.getEventY() * height / mc.displayHeight - 1; super.handleMouseInput(); if(listText != null) listText.handleMouseInput(mouseX, mouseY); listGroups.handleMouseInput(mouseX, mouseY); }
@Override protected boolean isPointInRegion(int p_146978_1_, int p_146978_2_, int p_146978_3_, int p_146978_4_, int p_146978_5_, int p_146978_6_) { int x = Mouse.getEventX() * this.width / this.mc.displayWidth; int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; for (IGuiOverlay overlay : overlays) { if (overlay != null && overlay.isVisible() && overlay.isMouseInBounds(x, y)) { return false; } } return super.isPointInRegion(p_146978_1_, p_146978_2_, p_146978_3_, p_146978_4_, p_146978_5_, p_146978_6_); }
@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); } } }
@SubscribeEvent public void onGuiMouseEvent(GuiScreenEvent.MouseInputEvent.Pre event) { GuiScreen guiScreen = event.getGui(); int x = Mouse.getEventX() * guiScreen.width / guiScreen.mc.displayWidth; int y = guiScreen.height - Mouse.getEventY() * guiScreen.height / guiScreen.mc.displayHeight - 1; if (handleMouseEvent(guiScreen, x, y)) { event.setCanceled(true); } }
@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 wheel = Mouse.getDWheel(); final int mx = Mouse.getEventX() * super.width / super.mc.displayWidth - x; final int my = super.height - Mouse.getEventY() * super.height / super.mc.displayHeight - 1 - y; window.handleHover(mx, my); if(wheel != 0) { window.scrollInput(wheel); } }
@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); } }
public MouseEvent(IWidget widget) { this.srcwidget = widget; this.timestamp = System.nanoTime(); this.mc = Minecraft.getMinecraft(); this.x = (double) Mouse.getEventX() * (double) this.srcwidget.getSize().getX() / (double) this.mc.displayWidth; this.y = (double) this.srcwidget.getSize().getY() - (double) Mouse.getEventY() * (double) this.srcwidget.getSize().getY() / (double) this.mc.displayHeight - 1.0; //this.x = Mouse.getEventX(); //this.y = Mouse.getEventY(); //System.out.printf("%s %s\n", this.x, this.y); //this.z = Mouse.getEventDWheel(); this.z = Mouse.getDWheel(); for (int i = 0; i < buttonCount; i++) buttonState[i] = Mouse.isButtonDown(i); this.trgwidget = this.srcwidget.getWidgetAtCoordinates(this.x, this.y); }