Fixed git clone URL
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / gui / humaninput / MouseEvent.java
1 /*
2  * Sixth 3D engine. Author: Svjatoslav Agejenko.
3  * This project is released under Creative Commons Zero (CC0) license.
4  */
5 package eu.svjatoslav.sixth.e3d.gui.humaninput;
6
7 import eu.svjatoslav.sixth.e3d.geometry.Point2D;
8
9 /**
10  * Represents mouse event.
11  */
12 public class MouseEvent {
13
14     /**
15      * Mouse coordinate in screen space (pixels) relative to top left corner of the screen
16      * when mouse button was clicked.
17      */
18     public Point2D coordinate;
19
20     /**
21      * <pre>
22      * 0 - mouse over (no button pressed)
23      * 1 - left mouse button
24      * 2 - middle mouse button
25      * 3 - right mouse button
26      * </pre>
27      */
28     public int button;
29
30     MouseEvent(final int x, final int y, final int button) {
31         this(new Point2D(x, y), button);
32     }
33
34     MouseEvent(final Point2D coordinate, final int button) {
35         this.coordinate = coordinate;
36         this.button = button;
37     }
38
39     @Override
40     public String toString() {
41         return "MouseEvent{" +
42                 "coordinate=" + coordinate +
43                 ", button=" + button +
44                 '}';
45     }
46 }