Path: blob/master/SLICK_HOME/src/org/newdawn/slick/command/KeyControl.java
1456 views
package org.newdawn.slick.command;12/**3* A control relating to a command indicate that it should be fired when a specific key is pressed4* or released.5*6* @author joverton7*/8public class KeyControl implements Control {9/** The key code that needs to be pressed */10private int keycode;1112/**13* Create a new control that caused an command to be fired on a key pressed/released14*15* @param keycode The code of the key that causes the command16*/17public KeyControl(int keycode) {18this.keycode = keycode;19}2021/**22* @see java.lang.Object#equals(java.lang.Object)23*/24public boolean equals(Object o) {25if (o instanceof KeyControl) {26return ((KeyControl)o).keycode == keycode;27}2829return false;30}3132/**33* @see java.lang.Object#hashCode()34*/35public int hashCode() {36return keycode;37}38}394041