X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTKeypress.java;h=c4fd8b45b181dd9eb756ec5378864d1d1b38c3ca;hb=4328bb42c10743287dad5cf045f059ad109eb540;hp=4f5f0afcd74007df6815fe8f64a269f04019e7d6;hpb=05dbb28d6e8613216f43e8d0fae487c1d9c2fcd3;p=fanfix.git diff --git a/src/jexer/TKeypress.java b/src/jexer/TKeypress.java index 4f5f0af..c4fd8b4 100644 --- a/src/jexer/TKeypress.java +++ b/src/jexer/TKeypress.java @@ -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. */