Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epoxy
GitHub Repository: epoxy/proj11
Path: blob/master/SLICK_HOME/src/org/newdawn/slick/command/MouseButtonControl.java
1456 views
1
package org.newdawn.slick.command;
2
3
/**
4
* A control indicating that a mouse button must be pressed or released to cause an command
5
*
6
* @author joverton
7
*/
8
public class MouseButtonControl implements Control {
9
/** The button to be pressed */
10
private int button;
11
12
/**
13
* Create a new control that indicates a mouse button to be pressed or released
14
*
15
* @param button The button that should be pressed to cause the command
16
*/
17
public MouseButtonControl(int button) {
18
this.button = button;
19
}
20
21
/**
22
* @see java.lang.Object#equals(java.lang.Object)
23
*/
24
public boolean equals(Object o) {
25
if (o instanceof MouseButtonControl)
26
{
27
return ((MouseButtonControl)o).button == button;
28
}
29
30
return false;
31
}
32
33
/**
34
* @see java.lang.Object#hashCode()
35
*/
36
public int hashCode() {
37
return button;
38
}
39
}
40
41