HELLO WORLD...
[fanfix.git] / src / jexer / TKeypress.java
index 4f5f0afcd74007df6815fe8f64a269f04019e7d6..c4fd8b45b181dd9eb756ec5378864d1d1b38c3ca 100644 (file)
@@ -225,6 +225,24 @@ public class TKeypress {
        this.shift = shift;
     }
 
+    /**
+     * Comparison.  All fields must match to return true.
+     */
+    @Override
+    public boolean equals(Object rhs) {
+       if (!(rhs instanceof TKeypress)) {
+           return false;
+       }
+
+       TKeypress that = (TKeypress)rhs;
+       return ((isKey == that.isKey) &&
+           (fnKey == that.fnKey) &&
+           (ch == that.ch) &&
+           (alt == that.alt) &&
+           (ctrl == that.ctrl) &&
+           (shift == that.shift));
+    }
+
     /**
      * Make human-readable description of this Keystroke.
      */