generated from sigonasr2/JavaProjectTemplate
parent
519ce6d10a
commit
f17d0e93d4
@ -1,10 +1,27 @@ |
|||||||
package sig.engine; |
package sig.engine; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
|
||||||
public class Mouse { |
public class Mouse { |
||||||
public static int x; |
public static int x; |
||||||
public static int y; |
public static int y; |
||||||
|
public static HashMap<Integer,Boolean> clickMap=new HashMap<>(); |
||||||
|
public static HashMap<Integer,Boolean> pressMap=new HashMap<>(); |
||||||
|
public static HashMap<Integer,Boolean> releaseMap=new HashMap<>(); |
||||||
public static Point<Integer> mousePosition = new Point<Integer>(0,0); |
public static Point<Integer> mousePosition = new Point<Integer>(0,0); |
||||||
public static Point<Integer> GetPos(){ |
public static Point<Integer> GetPos(){ |
||||||
return new Point<Integer>(x,y); |
return new Point<Integer>(x,y); |
||||||
} |
} |
||||||
|
//0=Left click, 1=Right click, 2=Middle, 3=Button 4, 4=Button 5
|
||||||
|
public static boolean isHeld(Integer button){ |
||||||
|
return clickMap.getOrDefault(button,false); |
||||||
|
} |
||||||
|
//0=Left click, 1=Right click, 2=Middle, 3=Button 4, 4=Button 5
|
||||||
|
public static boolean isPressed(Integer button){ |
||||||
|
return pressMap.getOrDefault(button,false); |
||||||
|
} |
||||||
|
//0=Left click, 1=Right click, 2=Middle, 3=Button 4, 4=Button 5
|
||||||
|
public static boolean isReleased(Integer button){ |
||||||
|
return releaseMap.getOrDefault(button,false); |
||||||
|
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue