/* * Minecraft Forge * Copyright (c) 2016. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation version 2.1 * of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package net.minecraftforge.client.event; import org.lwjgl.input.Mouse; import net.minecraftforge.fml.common.eventhandler.Cancelable; import net.minecraftforge.fml.common.eventhandler.Event; /** * Author: MachineMuse (Claire Semple) * Created: 2:46 PM, 9/4/13 */ @Cancelable public class MouseEvent extends Event { private final int x; private final int y; private final int dx; private final int dy; private final int dwheel; private final int button; private final boolean buttonstate; private final long nanoseconds; public MouseEvent() { this.x = Mouse.getEventX(); this.y = Mouse.getEventY(); this.dx = Mouse.getEventDX(); this.dy = Mouse.getEventDY(); this.dwheel = Mouse.getEventDWheel(); this.button = Mouse.getEventButton(); this.buttonstate = Mouse.getEventButtonState(); this.nanoseconds = Mouse.getEventNanoseconds(); } public int getX() { return x; } public int getY() { return y; } public int getDx() { return dx; } public int getDy() { return dy; } public int getDwheel() { return dwheel; } public int getButton() { return button; } public boolean isButtonstate() { return buttonstate; } public long getNanoseconds() { return nanoseconds; } }