def process_key ch
      chr = nil
      if ch > 0 and ch < 256
        chr = ch.chr
      end
      return :UNHANDLED unless @key_map
      @key_map.each_pair do |k,p|
        #$log.debug "KKK:  processing key #{ch}  #{chr} "
        if (k == ch || k == chr)
          #$log.debug "KKK:  checking match == #{k}: #{ch}  #{chr} "
          # compare both int key and chr
          #$log.debug "KKK:  found match 1 #{ch}  #{chr} "
          p.call(self, ch)
          return 0
        elsif k.respond_to? :include?
            #$log.debug "KKK:  checking match include #{k}: #{ch}  #{chr} "
            # this bombs if its a String and we check for include of a ch.
          if !k.is_a?( String ) && (k.include?( ch ) || k.include?(chr))
            #$log.debug "KKK:  found match include #{ch}  #{chr} "
            p.call(self, ch)
            return 0
          end
        elsif k.is_a? Regexp
          if k.match(chr)
            #$log.debug "KKK:  found match regex #{ch}  #{chr} "
            p.call(self, ch)
            return 0
          end
        end
      end
      return :UNHANDLED
    end
def process_key ch
      chr = nil
      if ch > 0 and ch < 256
        chr = ch.chr
      end
      return :UNHANDLED unless @key_map
      @key_map.each_pair do |k,p|
        #$log.debug "KKK:  processing key #{ch}  #{chr} "
        if (k == ch || k == chr)
          #$log.debug "KKK:  checking match == #{k}: #{ch}  #{chr} "
          # compare both int key and chr
          #$log.debug "KKK:  found match 1 #{ch}  #{chr} "
          p.call(self, ch)
          return 0
        elsif k.respond_to? :include?
            #$log.debug "KKK:  checking match include #{k}: #{ch}  #{chr} "
            # this bombs if its a String and we check for include of a ch.
          if !k.is_a?( String ) && (k.include?( ch ) || k.include?(chr))
            #$log.debug "KKK:  found match include #{ch}  #{chr} "
            p.call(self, ch)
            return 0
          end
        elsif k.is_a? Regexp
          if k.match(chr)
            #$log.debug "KKK:  found match regex #{ch}  #{chr} "
            p.call(self, ch)
            return 0
          end
        end
      end
      return :UNHANDLED
    end
checks the key against +@key_map+ if its set
 @param [Integer] ch character read by +Window+
 @return [0, :UNHANDLED] 0 if processed, :UNHANDLED if not processed so higher level can process