keyboard accelerators
[fanfix.git] / src / jexer / event / TKeypressEvent.java
index 03c4f71e5ed510b93711887b676c89c337e764d0..bf8a51afe09ce4ec7f723a202c4dfcd12f9684e3 100644 (file)
@@ -115,6 +115,21 @@ public final class TKeypressEvent extends TInputEvent {
         return (key.equals(that));
     }
 
+    /**
+     * Hashcode uses all fields in equals().
+     *
+     * @return the hash
+     */
+    @Override
+    public int hashCode() {
+        int A = 13;
+        int B = 23;
+        int hash = A;
+        hash = (B * hash) + getTime().hashCode();
+        hash = (B * hash) + key.hashCode();
+        return hash;
+    }
+
     /**
      * Make human-readable description of this TKeypressEvent.
      *