boolean (final @NotNull Shortcut sc) { if (!(sc instanceof KeyboardModifierGestureShortcut other)) return false; if (myType.equals(other.myType)) { if (myStroke.getModifiers() != other.myStroke.getModifiers()) return false; return other.myStroke.getKeyCode() != -1 || other.myStroke.getKeyCode() == myStroke.getKeyCode(); } return false; }