global

def match?(other)

def match?(other)
  case other
  when Reline::Key
    (other.char.nil? or char.nil? or char == other.char) and
    (other.combined_char.nil? or combined_char.nil? or combined_char == other.combined_char) and
    (other.with_meta.nil? or with_meta.nil? or with_meta == other.with_meta)
  when Integer, Symbol
    (combined_char and combined_char == other) or
    (combined_char.nil? and char and char == other)
  else
    false
  end
end