2022-11-28 16:11:16 -06:00
|
|
|
package sig.engine;
|
|
|
|
|
2022-11-28 17:40:44 -06:00
|
|
|
import java.util.HashMap;
|
|
|
|
|
2022-11-28 16:11:16 -06:00
|
|
|
public class Mouse {
|
|
|
|
public static int x;
|
|
|
|
public static int y;
|
2022-11-28 17:40:44 -06:00
|
|
|
public static HashMap<Integer,Boolean> clickMap=new HashMap<>();
|
|
|
|
public static HashMap<Integer,Boolean> pressMap=new HashMap<>();
|
|
|
|
public static HashMap<Integer,Boolean> releaseMap=new HashMap<>();
|
2022-11-28 16:11:16 -06:00
|
|
|
public static Point<Integer> mousePosition = new Point<Integer>(0,0);
|
|
|
|
public static Point<Integer> GetPos(){
|
|
|
|
return new Point<Integer>(x,y);
|
|
|
|
}
|
2022-11-28 17:40:44 -06:00
|
|
|
//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);
|
|
|
|
}
|
2022-11-28 16:11:16 -06:00
|
|
|
}
|